<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>css平行四边形</title>
	<style>
		.test {
			width: 100px;
			height: 60px;
			background-color: purple;
			margin: 100px auto;
			transform:skew(30deg);
			-webkit-transform:skew(30deg);
			-moz-transform:skew(30deg);
			-ms-transform:skew(30deg);
			-o-transform:skew(30deg);

		}
	</style>
</head>
<body>
	<div class="test"></div>


	<script>
		var BROWSER = {};
		var USERAGENT = navigator.userAgent.toLowerCase();
		browserVersion({'ie': 'msie','firefox': '','chrome': '','opera': '','safari': '','mozilla': '','webkit': '','maxthon': '','qq': 'qqbrowser','rv': 'rv'});
		if (BROWSER.safari) {
		    BROWSER.firefox = true;
		}
		BROWSER.opera = BROWSER.opera ? opera.version() : 0;
		HTMLNODE = document.getElementsByTagName('head')[0].parentNode;
		if (BROWSER.ie) {
		    BROWSER.iemode = parseInt(typeof document.documentMode != 'undefined' ? document.documentMode : BROWSER.ie);
		    HTMLNODE.className = 'ie_all ie' + BROWSER.iemode;
		}
		var CSSLOADED = [];
		var JSLOADED = [];
		var JSMENU = [];
		JSMENU['active'] = [];
		JSMENU['timer'] = [];
		JSMENU['drag'] = [];
		JSMENU['layer'] = 0;
		JSMENU['zIndex'] = {'win': 200,'menu': 300,'dialog': 400,'prompt': 500};
		JSMENU['float'] = '';
		var CURRENTSTYPE = null;
		var discuz_uid = isUndefined(discuz_uid) ? 0 : discuz_uid;
		var creditnotice = isUndefined(creditnotice) ? '' : creditnotice;
		var cookiedomain = isUndefined(cookiedomain) ? '' : cookiedomain;
		var cookiepath = isUndefined(cookiepath) ? '' : cookiepath;
		var EXTRAFUNC = [], EXTRASTR = '';
		EXTRAFUNC['showmenu'] = [];
		var DISCUZCODE = [];
		DISCUZCODE['num'] = '-1';
		DISCUZCODE['html'] = [];
		var USERABOUT_BOX = true;
		var USERCARDST = null;
		var CLIPBOARDSWFDATA = '';
		var NOTICETITLE = [];
		var NOTICECURTITLE = document.title;
		if (BROWSER.firefox && window.HTMLElement) {
		    HTMLElement.prototype.__defineGetter__("innerText", function() {
		        var anyString = "";
		        var childS = this.childNodes;
		        for (var i = 0; i < childS.length; i++) {
		            if (childS[i].nodeType == 1) {
		                anyString += childS[i].tagName == "BR" ? '\n' : childS[i].innerText;
		            } else if (childS[i].nodeType == 3) {
		                anyString += childS[i].nodeValue;
		            }
		        }
		        return anyString;
		    });
		    HTMLElement.prototype.__defineSetter__("innerText", function(sText) {
		        this.textContent = sText;
		    });
		    HTMLElement.prototype.__defineSetter__('outerHTML', function(sHTML) {
		        var r = this.ownerDocument.createRange();
		        r.setStartBefore(this);
		        var df = r.createContextualFragment(sHTML);
		        this.parentNode.replaceChild(df, this);
		        return sHTML;
		    });
		    HTMLElement.prototype.__defineGetter__('outerHTML', function() {
		        var attr;
		        var attrs = this.attributes;
		        var str = '<' + this.tagName.toLowerCase();
		        for (var i = 0; i < attrs.length; i++) {
		            attr = attrs[i];
		            if (attr.specified)
		                str += ' ' + attr.name + '="' + attr.value + '"';
		        }
		        if (!this.canHaveChildren) {
		            return str + '>';
		        }
		        return str + '>' + this.innerHTML + '</' + this.tagName.toLowerCase() + '>';
		    });
		    HTMLElement.prototype.__defineGetter__('canHaveChildren', function() {
		        switch (this.tagName.toLowerCase()) {
		            case 'area':
		            case 'base':
		            case 'basefont':
		            case 'col':
		            case 'frame':
		            case 'hr':
		            case 'img':
		            case 'br':
		            case 'input':
		            case 'isindex':
		            case 'link':
		            case 'meta':
		            case 'param':
		                return false;
		        }
		        return true;
		    });
		}
		function $(id) {
		    return !id ? null : document.getElementById(id);
		}
		function $C(classname, ele, tag) {
		    var returns = [];
		    ele = ele || document;
		    tag = tag || '*';
		    if (ele.getElementsByClassName) {
		        var eles = ele.getElementsByClassName(classname);
		        if (tag != '*') {
		            for (var i = 0, L = eles.length; i < L; i++) {
		                if (eles[i].tagName.toLowerCase() == tag.toLowerCase()) {
		                    returns.push(eles[i]);
		                }
		            }
		        } else {
		            returns = eles;
		        }
		    } else {
		        eles = ele.getElementsByTagName(tag);
		        var pattern = new RegExp("(^|\\s)" + classname + "(\\s|$)");
		        for (i = 0, L = eles.length; i < L; i++) {
		            if (pattern.test(eles[i].className)) {
		                returns.push(eles[i]);
		            }
		        }
		    }
		    return returns;
		}
		function _attachEvent(obj, evt, func, eventobj) {
		    eventobj = !eventobj ? obj : eventobj;
		    if (obj.addEventListener) {
		        obj.addEventListener(evt, func, false);
		    } else if (eventobj.attachEvent) {
		        obj.attachEvent('on' + evt, func);
		    }
		}
		function _detachEvent(obj, evt, func, eventobj) {
		    eventobj = !eventobj ? obj : eventobj;
		    if (obj.removeEventListener) {
		        obj.removeEventListener(evt, func, false);
		    } else if (eventobj.detachEvent) {
		        obj.detachEvent('on' + evt, func);
		    }
		}
		function browserVersion(types) {
		    var other = 1;
		    for (i in types) {
		        var v = types[i] ? types[i] : i;
		        if (USERAGENT.indexOf(v) != -1) {
		            var re = new RegExp(v + '(\\/|\\s|:)([\\d\\.]+)', 'ig');
		            var matches = re.exec(USERAGENT);
		            var ver = matches != null ? matches[2] : 0;
		            other = ver !== 0 && v != 'mozilla' ? 0 : other;
		        } else {
		            var ver = 0;
		        }
		        eval('BROWSER.' + i + '= ver');
		    }
		    BROWSER.other = other;
		}
		function getEvent() {
		    if (document.all)
		        return window.event;
		    func = getEvent.caller;
		    while (func != null) {
		        var arg0 = func.arguments[0];
		        if (arg0) {
		            if ((arg0.constructor == Event || arg0.constructor == MouseEvent) || (typeof (arg0) == "object" && arg0.preventDefault && arg0.stopPropagation)) {
		                return arg0;
		            }
		        }
		        func = func.caller;
		    }
		    return null;
		}
		function isUndefined(variable) {
		    return typeof variable == 'undefined' ? true : false;
		}
		function in_array(needle, haystack) {
		    if (typeof needle == 'string' || typeof needle == 'number') {
		        for (var i in haystack) {
		            if (haystack[i] == needle) {
		                return true;
		            }
		        }
		    }
		    return false;
		}
		function trim(str) {
		    return (str + '').replace(/(\s+)$/g, '').replace(/^\s+/g, '');
		}
		function strlen(str) {
		    return (BROWSER.ie && str.indexOf('\n') != -1) ? str.replace(/\r?\n/g, '_').length : str.length;
		}
		function mb_strlen(str) {
		    var len = 0;
		    for (var i = 0; i < str.length; i++) {
		        len += str.charCodeAt(i) < 0 || str.charCodeAt(i) > 255 ? (charset == 'utf-8' ? 3 : 2) : 1;
		    }
		    return len;
		}
		function mb_cutstr(str, maxlen, dot) {
		    var len = 0;
		    var ret = '';
		    var dot = !dot ? '...' : dot;
		    maxlen = maxlen - dot.length;
		    for (var i = 0; i < str.length; i++) {
		        len += str.charCodeAt(i) < 0 || str.charCodeAt(i) > 255 ? (charset == 'utf-8' ? 3 : 2) : 1;
		        if (len > maxlen) {
		            ret += dot;
		            break;
		        }
		        ret += str.substr(i, 1);
		    }
		    return ret;
		}
		function preg_replace(search, replace, str, regswitch) {
		    var regswitch = !regswitch ? 'ig' : regswitch;
		    var len = search.length;
		    for (var i = 0; i < len; i++) {
		        re = new RegExp(search[i], regswitch);
		        str = str.replace(re, typeof replace == 'string' ? replace : (replace[i] ? replace[i] : replace[0]));
		    }
		    return str;
		}
		function htmlspecialchars(str) {
		    return preg_replace(['&', '<', '>', '"'], ['&amp;', '&lt;', '&gt;', '&quot;'], str);
		}
		function display(id) {
		    var obj = $(id);
		    if (obj.style.visibility) {
		        obj.style.visibility = obj.style.visibility == 'visible' ? 'hidden' : 'visible';
		    } else {
		        obj.style.display = obj.style.display == '' ? 'none' : '';
		    }
		}
		function checkall(form, prefix, checkall) {
		    var checkall = checkall ? checkall : 'chkall';
		    count = 0;
		    for (var i = 0; i < form.elements.length; i++) {
		        var e = form.elements[i];
		        if (e.name && e.name != checkall && !e.disabled && (!prefix || (prefix && e.name.match(prefix)))) {
		            e.checked = form.elements[checkall].checked;
		            if (e.checked) {
		                count++;
		            }
		        }
		    }
		    return count;
		}
		function setcookie(cookieName, cookieValue, seconds, path, domain, secure) {
		    if (cookieValue == '' || seconds < 0) {
		        cookieValue = '';
		        seconds = -2592000;
		    }
		    if (seconds) {
		        var expires = new Date();
		        expires.setTime(expires.getTime() + seconds * 1000);
		    }
		    domain = !domain ? cookiedomain : domain;
		    path = !path ? cookiepath : path;
		    document.cookie = escape(cookiepre + cookieName) + '=' + escape(cookieValue) + (expires ? '; expires=' + expires.toGMTString() : '') + (path ? '; path=' + path : '/') + (domain ? '; domain=' + domain : '') + (secure ? '; secure' : '');
		}
		function getcookie(name, nounescape) {
		    name = cookiepre + name;
		    var cookie_start = document.cookie.indexOf(name);
		    var cookie_end = document.cookie.indexOf(";", cookie_start);
		    if (cookie_start == -1) {
		        return '';
		    } else {
		        var v = document.cookie.substring(cookie_start + name.length + 1, (cookie_end > cookie_start ? cookie_end : document.cookie.length));
		        return !nounescape ? unescape(v) : v;
		    }
		}
		function Ajax(recvType, waitId) {
		    var aj = new Object();
		    aj.loading = '请稍候...';
		    aj.recvType = recvType ? recvType : 'XML';
		    aj.waitId = waitId ? $(waitId) : null;
		    aj.error = false;
		    aj.resultHandle = null;
		    aj.sendString = '';
		    aj.targetUrl = '';
		    aj.setLoading = function(loading) {
		        if (typeof loading !== 'undefined' && loading !== null)
		            aj.loading = loading;
		    };
		    aj.setRecvType = function(recvtype) {
		        aj.recvType = recvtype;
		    };
		    aj.setWaitId = function(waitid) {
		        aj.waitId = typeof waitid == 'object' ? waitid : $(waitid);
		    };
		    aj.createXMLHttpRequest = function() {
		        var request = false;
		        if (window.XMLHttpRequest) {
		            request = new XMLHttpRequest();
		            if (request.overrideMimeType) {
		                request.overrideMimeType('text/xml');
		            }
		        } else if (window.ActiveXObject) {
		            var versions = ['Microsoft.XMLHTTP', 'MSXML.XMLHTTP', 'Microsoft.XMLHTTP', 'Msxml2.XMLHTTP.7.0', 'Msxml2.XMLHTTP.6.0', 'Msxml2.XMLHTTP.5.0', 'Msxml2.XMLHTTP.4.0', 'MSXML2.XMLHTTP.3.0', 'MSXML2.XMLHTTP'];
		            for (var i = 0; i < versions.length; i++) {
		                try {
		                    request = new ActiveXObject(versions[i]);
		                    if (request) {
		                        return request;
		                    }
		                } catch (e) {
		                }
		            }
		        }
		        return request;
		    };
		    aj.XMLHttpRequest = aj.createXMLHttpRequest();
		    aj.showLoading = function() {
		        if (aj.waitId && (aj.XMLHttpRequest.readyState != 4 || aj.XMLHttpRequest.status != 200)) {
		            aj.waitId.style.display = '';
		            aj.waitId.innerHTML = '<span><img src="' + IMGDIR + '/loading.gif" class="vm"> ' + aj.loading + '</span>';
		        }
		    };
		    aj.processHandle = function() {
		        if (aj.XMLHttpRequest.readyState == 4 && aj.XMLHttpRequest.status == 200) {
		            if (aj.waitId) {
		                aj.waitId.style.display = 'none';
		            }
		            if (aj.recvType == 'HTML') {
		                aj.resultHandle(aj.XMLHttpRequest.responseText, aj);
		            } else if (aj.recvType == 'XML') {
		                if (!aj.XMLHttpRequest.responseXML || !aj.XMLHttpRequest.responseXML.lastChild || aj.XMLHttpRequest.responseXML.lastChild.localName == 'parsererror') {
		                    aj.error = true;
		                    aj.resultHandle('<a href="' + aj.targetUrl + '" target="_blank" style="color:red">内部错误，无法显示此内容</a>', aj);
		                } else {
		                    aj.resultHandle(aj.XMLHttpRequest.responseXML.lastChild.firstChild.nodeValue, aj);
		                }
		            } else if (aj.recvType == 'JSON') {
		                var s = null;
		                try {
		                    s = (new Function("return (" + aj.XMLHttpRequest.responseText + ")"))();
		                } catch (e) {
		                    s = null;
		                }
		                aj.resultHandle(s, aj);
		            }
		        }
		    };
		    aj.get = function(targetUrl, resultHandle) {
		        targetUrl = hostconvert(targetUrl);
		        setTimeout(function() {
		            aj.showLoading()
		        }, 250);
		        aj.targetUrl = targetUrl;
		        aj.XMLHttpRequest.onreadystatechange = aj.processHandle;
		        aj.resultHandle = resultHandle;
		        var attackevasive = isUndefined(attackevasive) ? 0 : attackevasive;
		        if (window.XMLHttpRequest) {
		            aj.XMLHttpRequest.open('GET', aj.targetUrl);
		            aj.XMLHttpRequest.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
		            aj.XMLHttpRequest.send(null);
		        } else {
		            aj.XMLHttpRequest.open("GET", targetUrl, true);
		            aj.XMLHttpRequest.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
		            aj.XMLHttpRequest.send();
		        }
		    };
		    aj.post = function(targetUrl, sendString, resultHandle) {
		        targetUrl = hostconvert(targetUrl);
		        setTimeout(function() {
		            aj.showLoading()
		        }, 250);
		        aj.targetUrl = targetUrl;
		        aj.sendString = sendString;
		        aj.XMLHttpRequest.onreadystatechange = aj.processHandle;
		        aj.resultHandle = resultHandle;
		        aj.XMLHttpRequest.open('POST', targetUrl);
		        aj.XMLHttpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
		        aj.XMLHttpRequest.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
		        aj.XMLHttpRequest.send(aj.sendString);
		    };
		    aj.getJSON = function(targetUrl, resultHandle) {
		        aj.setRecvType('JSON');
		        aj.get(targetUrl + '&ajaxdata=json', resultHandle);
		    };
		    aj.getHTML = function(targetUrl, resultHandle) {
		        aj.setRecvType('HTML');
		        aj.get(targetUrl + '&ajaxdata=html', resultHandle);
		    };
		    return aj;
		}
		function getHost(url) {
		    var host = "null";
		    if (typeof url == "undefined" || null == url) {
		        url = window.location.href;
		    }
		    var regex = /^\w+\:\/\/([^\/]*).*/;
		    var match = url.match(regex);
		    if (typeof match != "undefined" && null != match) {
		        host = match[1];
		    }
		    return host;
		}
		function hostconvert(url) {
		    if (!url.match(/^https?:\/\//))
		        url = SITEURL + url;
		    var url_host = getHost(url);
		    var cur_host = getHost().toLowerCase();
		    if (url_host && cur_host != url_host) {
		        url = url.replace(url_host, cur_host);
		    }
		    return url;
		}
		function newfunction(func) {
		    var args = [];
		    for (var i = 1; i < arguments.length; i++)
		        args.push(arguments[i]);
		    return function(event) {
		        doane(event);
		        window[func].apply(window, args);
		        return false;
		    }
		}
		function evalscript(s) {
		    if (s.indexOf('<script') == -1)
		        return s;
		    var p = /<script[^\>]*?>([^\x00]*?)<\/script>/ig;
		    var arr = [];
		    while (arr = p.exec(s)) {
		        var p1 = /<script[^\>]*?src=\"([^\>]*?)\"[^\>]*?(reload=\"1\")?(?:charset=\"([\w\-]+?)\")?><\/script>/i;
		        var arr1 = [];
		        arr1 = p1.exec(arr[0]);
		        if (arr1) {
		            appendscript(arr1[1], '', arr1[2], arr1[3]);
		        } else {
		            p1 = /<script(.*?)>([^\x00]+?)<\/script>/i;
		            arr1 = p1.exec(arr[0]);
		            appendscript('', arr1[2], arr1[1].indexOf('reload=') != -1);
		        }
		    }
		    return s;
		}
		var safescripts = {}, evalscripts = [];
		function safescript(id, call, seconds, times, timeoutcall, endcall, index) {
		    seconds = seconds || 1000;
		    times = times || 0;
		    var checked = true;
		    try {
		        if (typeof call == 'function') {
		            call();
		        } else {
		            eval(call);
		        }
		    } catch (e) {
		        checked = false;
		    }
		    if (!checked) {
		        if (!safescripts[id] || !index) {
		            safescripts[id] = safescripts[id] || [];
		            safescripts[id].push({'times': 0,'si': setInterval(function() {
		                    safescript(id, call, seconds, times, timeoutcall, endcall, safescripts[id].length);
		                }, seconds)});
		        } else {
		            index = (index || 1) - 1;
		            safescripts[id][index]['times']++;
		            if (safescripts[id][index]['times'] >= times) {
		                clearInterval(safescripts[id][index]['si']);
		                if (typeof timeoutcall == 'function') {
		                    timeoutcall();
		                } else {
		                    eval(timeoutcall);
		                }
		            }
		        }
		    } else {
		        try {
		            index = (index || 1) - 1;
		            if (safescripts[id][index]['si']) {
		                clearInterval(safescripts[id][index]['si']);
		            }
		            if (typeof endcall == 'function') {
		                endcall();
		            } else {
		                eval(endcall);
		            }
		        } catch (e) {
		        }
		    }
		}
		function $F(func, args, script) {
		    var run = function() {
		        var argc = args.length, s = '';
		        for (i = 0; i < argc; i++) {
		            s += ',args[' + i + ']';
		        }
		        eval('var check = typeof ' + func + ' == \'function\'');
		        if (check) {
		            eval(func + '(' + s.substr(1) + ')');
		        } else {
		            setTimeout(function() {
		                checkrun();
		            }, 50);
		        }
		    };
		    var checkrun = function() {
		        if (JSLOADED[src]) {
		            run();
		        } else {
		            setTimeout(function() {
		                checkrun();
		            }, 50);
		        }
		    };
		    script = script || 'common_extra';
		    src = JSPATH + script + '.js?' + VERHASH;
		    if (!JSLOADED[src]) {
		        appendscript(src);
		    }
		    checkrun();
		}
		function appendscript(src, text, reload, charset) {
		    var id = hash(src + text);
		    if (!reload && in_array(id, evalscripts))
		        return;
		    if (reload && $(id)) {
		        $(id).parentNode.removeChild($(id));
		    }
		    evalscripts.push(id);
		    var scriptNode = document.createElement("script");
		    scriptNode.type = "text/javascript";
		    scriptNode.id = id;
		    scriptNode.charset = charset ? charset : (BROWSER.firefox ? document.characterSet : document.charset);
		    try {
		        if (src) {
		            scriptNode.src = src;
		            scriptNode.onloadDone = false;
		            scriptNode.onload = function() {
		                scriptNode.onloadDone = true;
		                JSLOADED[src] = 1;
		            };
		            scriptNode.onreadystatechange = function() {
		                if ((scriptNode.readyState == 'loaded' || scriptNode.readyState == 'complete') && !scriptNode.onloadDone) {
		                    scriptNode.onloadDone = true;
		                    JSLOADED[src] = 1;
		                }
		            };
		        } else if (text) {
		            scriptNode.text = text;
		        }
		        document.getElementsByTagName('head')[0].appendChild(scriptNode);
		    } catch (e) {
		    }
		}
		function stripscript(s) {
		    return s.replace(/<script.*?>.*?<\/script>/ig, '');
		}
		function ajaxupdateevents(obj, tagName) {
		    tagName = tagName ? tagName : 'A';
		    var objs = obj.getElementsByTagName(tagName);
		    for (k in objs) {
		        var o = objs[k];
		        ajaxupdateevent(o);
		    }
		}
		function ajaxupdateevent(o) {
		    if (typeof o == 'object' && o.getAttribute) {
		        if (o.getAttribute('ajaxtarget')) {
		            if (!o.id)
		                o.id = Math.random();
		            var ajaxevent = o.getAttribute('ajaxevent') ? o.getAttribute('ajaxevent') : 'click';
		            var ajaxurl = o.getAttribute('ajaxurl') ? o.getAttribute('ajaxurl') : o.href;
		            _attachEvent(o, ajaxevent, newfunction('ajaxget', ajaxurl, o.getAttribute('ajaxtarget'), o.getAttribute('ajaxwaitid'), o.getAttribute('ajaxloading'), o.getAttribute('ajaxdisplay')));
		            if (o.getAttribute('ajaxfunc')) {
		                o.getAttribute('ajaxfunc').match(/(\w+)\((.+?)\)/);
		                _attachEvent(o, ajaxevent, newfunction(RegExp.$1, RegExp.$2));
		            }
		        }
		    }
		}
		function ajaxget(url, showid, waitid, loading, display, recall) {
		    waitid = typeof waitid == 'undefined' || waitid === null ? showid : waitid;
		    var x = new Ajax();
		    x.setLoading(loading);
		    x.setWaitId(waitid);
		    x.display = typeof display == 'undefined' || display == null ? '' : display;
		    x.showId = $(showid);
		    if (url.substr(strlen(url) - 1) == '#') {
		        url = url.substr(0, strlen(url) - 1);
		        x.autogoto = 1;
		    }
		    var url = url + '&inajax=1&ajaxtarget=' + showid;
		    x.get(url, function(s, x) {
		        if (s.indexOf("window.location.href") == 0) {
		            eval(s);
		            return;
		        }
		        if (!x.error) {
		            var evaled = false;
		            if (s.indexOf('ajaxerror') != -1) {
		                evalscript(s);
		                evaled = true;
		            }
		            if (!evaled && (typeof ajaxerror == 'undefined' || !ajaxerror)) {
		                if (x.showId) {
		                    x.showId.style.display = x.display;
		                    ajaxinnerhtml(x.showId, s);
		                    ajaxupdateevents(x.showId);
		                    if (x.autogoto)
		                        scroll(0, x.showId.offsetTop);
		                }
		            }
		            ajaxerror = null;
		            if (recall && typeof recall == 'function') {
		                recall();
		            } else if (recall) {
		                eval(recall);
		            }
		            if (!evaled)
		                evalscript(s);
		        }
		    });
		}
		function ajaxpost(formid, showid, waitid, showidclass, submitbtn, recall) {
		    var waitid = typeof waitid == 'undefined' || waitid === null ? showid : (waitid !== '' ? waitid : '');
		    var showidclass = !showidclass ? '' : showidclass;
		    var ajaxframeid = 'ajaxframe';
		    var ajaxframe = $(ajaxframeid);
		    var curform = $(formid);
		    var formtarget = curform.target;
		    var handleResult = function() {
		        var s = '';
		        var evaled = false;
		        showloading('none');
		        try {
		            s = $(ajaxframeid).contentWindow.document.XMLDocument.text;
		        } catch (e) {
		            try {
		                s = $(ajaxframeid).contentWindow.document.documentElement.firstChild.wholeText;
		            } catch (e) {
		                try {
		                    s = $(ajaxframeid).contentWindow.document.documentElement.firstChild.nodeValue;
		                } catch (e) {
		                    s = '内部错误，无法显示此内容';
		                }
		            }
		        }
		        if (s != '' && s.indexOf('ajaxerror') != -1) {
		            evalscript(s);
		            evaled = true;
		        }
		        if (showidclass) {
		            if (showidclass != 'onerror') {
		                $(showid).className = showidclass;
		            } else {
		                showError(s);
		                ajaxerror = true;
		            }
		        }
		        if (submitbtn) {
		            submitbtn.disabled = false;
		        }
		        if (!evaled && (typeof ajaxerror == 'undefined' || !ajaxerror)) {
		            ajaxinnerhtml($(showid), s);
		        }
		        ajaxerror = null;
		        if (curform)
		            curform.target = formtarget;
		        if (typeof recall == 'function') {
		            recall();
		        } else {
		            eval(recall);
		        }
		        if (!evaled)
		            evalscript(s);
		        ajaxframe.loading = 0;
		        if (!BROWSER.firefox || BROWSER.safari) {
		            $('append_parent').removeChild(ajaxframe.parentNode);
		        } else {
		            setTimeout(function() {
		                $('append_parent').removeChild(ajaxframe.parentNode);
		            }, 100);
		        }
		    };
		    if (!ajaxframe) {
		        var div = document.createElement('div');
		        div.style.display = 'none';
		        div.innerHTML = '<iframe name="' + ajaxframeid + '" id="' + ajaxframeid + '" loading="1"></iframe>';
		        $('append_parent').appendChild(div);
		        ajaxframe = $(ajaxframeid);
		    } else if (ajaxframe.loading) {
		        return false;
		    }
		    _attachEvent(ajaxframe, 'load', handleResult);
		    showloading();
		    curform.target = ajaxframeid;
		    var action = curform.getAttribute('action');
		    action = hostconvert(action);
		    curform.action = action.replace(/\&inajax\=1/g, '') + '&inajax=1';
		    curform.submit();
		    if (submitbtn) {
		        submitbtn.disabled = true;
		    }
		    doane();
		    return false;
		}
		function ajaxmenu(ctrlObj, timeout, cache, duration, pos, recall, idclass, contentclass) {
		    if (!ctrlObj.getAttribute('mid')) {
		        var ctrlid = ctrlObj.id;
		        if (!ctrlid) {
		            ctrlObj.id = 'ajaxid_' + Math.random();
		        }
		    } else {
		        var ctrlid = ctrlObj.getAttribute('mid');
		        if (!ctrlObj.id) {
		            ctrlObj.id = 'ajaxid_' + Math.random();
		        }
		    }
		    var menuid = ctrlid + '_menu';
		    var menu = $(menuid);
		    if (isUndefined(timeout))
		        timeout = 3000;
		    if (isUndefined(cache))
		        cache = 1;
		    if (isUndefined(pos))
		        pos = '43';
		    if (isUndefined(duration))
		        duration = timeout > 0 ? 0 : 3;
		    if (isUndefined(idclass))
		        idclass = 'p_pop';
		    if (isUndefined(contentclass))
		        contentclass = 'p_opt';
		    var func = function() {
		        showMenu({'ctrlid': ctrlObj.id,'menuid': menuid,'duration': duration,'timeout': timeout,'pos': pos,'cache': cache,'layer': 2});
		        if (typeof recall == 'function') {
		            recall();
		        } else {
		            eval(recall);
		        }
		    };
		    if (menu) {
		        if (menu.style.display == '') {
		            hideMenu(menuid);
		        } else {
		            func();
		        }
		    } else {
		        menu = document.createElement('div');
		        menu.id = menuid;
		        menu.style.display = 'none';
		        menu.className = idclass;
		        menu.innerHTML = '<div class="' + contentclass + '" id="' + menuid + '_content"></div>';
		        $('append_parent').appendChild(menu);
		        var url = (!isUndefined(ctrlObj.attributes['shref']) ? ctrlObj.attributes['shref'].value : (!isUndefined(ctrlObj.href) ? ctrlObj.href : ctrlObj.attributes['href'].value));
		        url += (url.indexOf('?') != -1 ? '&' : '?') + 'ajaxmenu=1';
		        ajaxget(url, menuid + '_content', 'ajaxwaitid', '', '', func);
		    }
		    doane();
		}
		function hash(string, length) {
		    var length = length ? length : 32;
		    var start = 0;
		    var i = 0;
		    var result = '';
		    filllen = length - string.length % length;
		    for (i = 0; i < filllen; i++) {
		        string += "0";
		    }
		    while (start < string.length) {
		        result = stringxor(result, string.substr(start, length));
		        start += length;
		    }
		    return result;
		}
		function stringxor(s1, s2) {
		    var s = '';
		    var hash = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
		    var max = Math.max(s1.length, s2.length);
		    for (var i = 0; i < max; i++) {
		        var k = s1.charCodeAt(i) ^ s2.charCodeAt(i);
		        s += hash.charAt(k % 52);
		    }
		    return s;
		}
		function showPreview(val, id) {
		    var showObj = $(id);
		    if (showObj) {
		        showObj.innerHTML = val.replace(/\n/ig, "<bupdateseccoder />");
		    }
		}
		function showloading(display, waiting) {
		    var display = display ? display : 'block';
		    var waiting = waiting ? waiting : '请稍候...';
		    $('ajaxwaitid').innerHTML = waiting;
		    $('ajaxwaitid').style.display = display;
		}
		function ajaxinnerhtml(showid, s) {
		    if (showid.tagName != 'TBODY') {
		        showid.innerHTML = s;
		    } else {
		        while (showid.firstChild) {
		            showid.firstChild.parentNode.removeChild(showid.firstChild);
		        }
		        var div1 = document.createElement('DIV');
		        div1.id = showid.id + '_div';
		        div1.innerHTML = '<table><tbody id="' + showid.id + '_tbody">' + s + '</tbody></table>';
		        $('append_parent').appendChild(div1);
		        var trs = div1.getElementsByTagName('TR');
		        var l = trs.length;
		        for (var i = 0; i < l; i++) {
		            showid.appendChild(trs[0]);
		        }
		        var inputs = div1.getElementsByTagName('INPUT');
		        var l = inputs.length;
		        for (var i = 0; i < l; i++) {
		            showid.appendChild(inputs[0]);
		        }
		        div1.parentNode.removeChild(div1);
		    }
		}
		function doane(event, preventDefault, stopPropagation) {
		    var preventDefault = isUndefined(preventDefault) ? 1 : preventDefault;
		    var stopPropagation = isUndefined(stopPropagation) ? 1 : stopPropagation;
		    e = event ? event : window.event;
		    if (!e) {
		        e = getEvent();
		    }
		    if (!e) {
		        return null;
		    }
		    if (preventDefault) {
		        if (e.preventDefault) {
		            e.preventDefault();
		        } else {
		            e.returnValue = false;
		        }
		    }
		    if (stopPropagation) {
		        if (e.stopPropagation) {
		            e.stopPropagation();
		        } else {
		            e.cancelBubble = true;
		        }
		    }
		    return e;
		}
		function loadcss(cssname) {
		    if (!CSSLOADED[cssname]) {
		        if (!$('css_' + cssname)) {
		            css = document.createElement('link');
		            css.id = 'css_' + cssname, css.type = 'text/css';
		            css.rel = 'stylesheet';
		            css.href = 'data/cache/style_' + STYLEID + '_' + cssname + '.css?' + VERHASH;
		            var headNode = document.getElementsByTagName("head")[0];
		            headNode.appendChild(css);
		        } else {
		            $('css_' + cssname).href = 'data/cache/style_' + STYLEID + '_' + cssname + '.css?' + VERHASH;
		        }
		        CSSLOADED[cssname] = 1;
		    }
		}
		function showMenu(v) {
		    var ctrlid = isUndefined(v['ctrlid']) ? v : v['ctrlid'];
		    var showid = isUndefined(v['showid']) ? ctrlid : v['showid'];
		    var menuid = isUndefined(v['menuid']) ? showid + '_menu' : v['menuid'];
		    var ctrlObj = $(ctrlid);
		    var menuObj = $(menuid);
		    if (!menuObj)
		        return;
		    var mtype = isUndefined(v['mtype']) ? 'menu' : v['mtype'];
		    var evt = isUndefined(v['evt']) ? 'mouseover' : v['evt'];
		    var pos = isUndefined(v['pos']) ? '43' : v['pos'];
		    var layer = isUndefined(v['layer']) ? 1 : v['layer'];
		    var duration = isUndefined(v['duration']) ? 2 : v['duration'];
		    var timeout = isUndefined(v['timeout']) ? 250 : v['timeout'];
		    var maxh = isUndefined(v['maxh']) ? 600 : v['maxh'];
		    var cache = isUndefined(v['cache']) ? 1 : v['cache'];
		    var drag = isUndefined(v['drag']) ? '' : v['drag'];
		    var dragobj = drag && $(drag) ? $(drag) : menuObj;
		    var fade = isUndefined(v['fade']) ? 0 : v['fade'];
		    var cover = isUndefined(v['cover']) ? 0 : v['cover'];
		    var zindex = isUndefined(v['zindex']) ? JSMENU['zIndex']['menu'] : v['zindex'];
		    var ctrlclass = isUndefined(v['ctrlclass']) ? '' : v['ctrlclass'];
		    var winhandlekey = isUndefined(v['win']) ? '' : v['win'];
		    zindex = cover ? zindex + 500 : zindex;
		    if (typeof JSMENU['active'][layer] == 'undefined') {
		        JSMENU['active'][layer] = [];
		    }
		    for (i in EXTRAFUNC['showmenu']) {
		        try {
		            eval(EXTRAFUNC['showmenu'][i] + '()');
		        } catch (e) {
		        }
		    }
		    if (evt == 'click' && in_array(menuid, JSMENU['active'][layer]) && mtype != 'win') {
		        hideMenu(menuid, mtype);
		        return;
		    }
		    if (mtype == 'menu') {
		        hideMenu(layer, mtype);
		    }
		    if (ctrlObj) {
		        if (!ctrlObj.getAttribute('initialized')) {
		            ctrlObj.setAttribute('initialized', true);
		            ctrlObj.unselectable = true;
		            ctrlObj.outfunc = typeof ctrlObj.onmouseout == 'function' ? ctrlObj.onmouseout : null;
		            ctrlObj.onmouseout = function() {
		                if (this.outfunc)
		                    this.outfunc();
		                if (duration < 3 && !JSMENU['timer'][menuid]) {
		                    JSMENU['timer'][menuid] = setTimeout(function() {
		                        hideMenu(menuid, mtype);
		                    }, timeout);
		                }
		            };
		            ctrlObj.overfunc = typeof ctrlObj.onmouseover == 'function' ? ctrlObj.onmouseover : null;
		            ctrlObj.onmouseover = function(e) {
		                doane(e);
		                if (this.overfunc)
		                    this.overfunc();
		                if (evt == 'click') {
		                    clearTimeout(JSMENU['timer'][menuid]);
		                    JSMENU['timer'][menuid] = null;
		                } else {
		                    for (var i in JSMENU['timer']) {
		                        if (JSMENU['timer'][i]) {
		                            clearTimeout(JSMENU['timer'][i]);
		                            JSMENU['timer'][i] = null;
		                        }
		                    }
		                }
		            };
		        }
		    }
		    if (!menuObj.getAttribute('initialized')) {
		        menuObj.setAttribute('initialized', true);
		        menuObj.ctrlkey = ctrlid;
		        menuObj.mtype = mtype;
		        menuObj.layer = layer;
		        menuObj.cover = cover;
		        if (ctrlObj && ctrlObj.getAttribute('fwin')) {
		            menuObj.scrolly = true;
		        }
		        menuObj.style.position = 'absolute';
		        menuObj.style.zIndex = zindex + layer;
		        menuObj.onclick = function(e) {
		            return doane(e, 0, 1);
		        };
		        if (duration < 3) {
		            if (duration > 1) {
		                menuObj.onmouseover = function() {
		                    clearTimeout(JSMENU['timer'][menuid]);
		                    JSMENU['timer'][menuid] = null;
		                };
		            }
		            if (duration != 1) {
		                menuObj.onmouseout = function() {
		                    JSMENU['timer'][menuid] = setTimeout(function() {
		                        hideMenu(menuid, mtype);
		                    }, timeout);
		                };
		            }
		        }
		        if (cover) {
		            var coverObj = document.createElement('div');
		            coverObj.id = menuid + '_cover';
		            coverObj.style.position = 'absolute';
		            coverObj.style.zIndex = menuObj.style.zIndex - 1;
		            coverObj.style.left = coverObj.style.top = '0px';
		            coverObj.style.width = '100%';
		            coverObj.style.height = Math.max(document.documentElement.clientHeight, document.body.offsetHeight) + 'px';
		            coverObj.style.backgroundColor = '#000';
		            coverObj.style.filter = 'progid:DXImageTransform.Microsoft.Alpha(opacity=50)';
		            coverObj.style.opacity = 0.5;
		            coverObj.onclick = function() {
		                hideMenu();
		            };
		            $('append_parent').appendChild(coverObj);
		            _attachEvent(window, 'load', function() {
		                coverObj.style.height = Math.max(document.documentElement.clientHeight, document.body.offsetHeight) + 'px';
		            }, document);
		        }
		    }
		    if (drag) {
		        dragobj.style.cursor = 'move';
		        dragobj.onmousedown = function(event) {
		            try {
		                dragMenu(menuObj, event, 1);
		            } catch (e) {
		            }
		        };
		    }
		    if (cover)
		        $(menuid + '_cover').style.display = '';
		    if (fade) {
		        var O = 0;
		        var fadeIn = function(O) {
		            if (O > 100) {
		                clearTimeout(fadeInTimer);
		                return;
		            }
		            menuObj.style.filter = 'progid:DXImageTransform.Microsoft.Alpha(opacity=' + O + ')';
		            menuObj.style.opacity = O / 100;
		            O += 20;
		            var fadeInTimer = setTimeout(function() {
		                fadeIn(O);
		            }, 40);
		        };
		        fadeIn(O);
		        menuObj.fade = true;
		    } else {
		        menuObj.fade = false;
		    }
		    menuObj.style.display = '';
		    if (ctrlObj && ctrlclass) {
		        ctrlObj.className += ' ' + ctrlclass;
		        menuObj.setAttribute('ctrlid', ctrlid);
		        menuObj.setAttribute('ctrlclass', ctrlclass);
		    }
		    if (pos != '*') {
		        setMenuPosition(showid, menuid, pos);
		    }
		    if (BROWSER.ie && BROWSER.ie < 7 && winhandlekey && $('fwin_' + winhandlekey)) {
		        $(menuid).style.left = (parseInt($(menuid).style.left) - parseInt($('fwin_' + winhandlekey).style.left)) + 'px';
		        $(menuid).style.top = (parseInt($(menuid).style.top) - parseInt($('fwin_' + winhandlekey).style.top)) + 'px';
		    }
		    if (maxh && menuObj.scrollHeight > maxh) {
		        menuObj.style.height = maxh + 'px';
		        if (BROWSER.opera) {
		            menuObj.style.overflow = 'auto';
		        } else {
		            menuObj.style.overflowY = 'auto';
		        }
		    }
		    if (!duration) {
		        setTimeout('hideMenu(\'' + menuid + '\', \'' + mtype + '\')', timeout);
		    }
		    if (!in_array(menuid, JSMENU['active'][layer]))
		        JSMENU['active'][layer].push(menuid);
		    menuObj.cache = cache;
		    if (layer > JSMENU['layer']) {
		        JSMENU['layer'] = layer;
		    }
		    var hasshow = function(ele) {
		        while (ele.parentNode && ((typeof (ele['currentStyle']) === 'undefined') ? window.getComputedStyle(ele, null) : ele['currentStyle'])['display'] !== 'none') {
		            ele = ele.parentNode;
		        }
		        if (ele === document) {
		            return true;
		        } else {
		            return false;
		        }
		    };
		    if (!menuObj.getAttribute('disautofocus')) {
		        try {
		            var focused = false;
		            var tags = ['input', 'select', 'textarea', 'button', 'a'];
		            for (var i = 0; i < tags.length; i++) {
		                var _all = menuObj.getElementsByTagName(tags[i]);
		                if (_all.length) {
		                    for (j = 0; j < _all.length; j++) {
		                        if ((!_all[j]['type'] || _all[j]['type'] != 'hidden') && hasshow(_all[j])) {
		                            _all[j].className += ' hidefocus';
		                            _all[j].focus();
		                            focused = true;
		                            var cobj = _all[j];
		                            _attachEvent(_all[j], 'blur', function() {
		                                cobj.className = trim(cobj.className.replace(' hidefocus', ''));
		                            });
		                            break;
		                        }
		                    }
		                }
		                if (focused) {
		                    break;
		                }
		            }
		        } catch (e) {
		        }
		    }
		}
		var delayShowST = null;
		function delayShow(ctrlObj, call, time) {
		    if (typeof ctrlObj == 'object') {
		        var ctrlid = ctrlObj.id;
		        call = call || function() {
		            showMenu(ctrlid);
		        };
		    }
		    var time = isUndefined(time) ? 500 : time;
		    delayShowST = setTimeout(function() {
		        if (typeof call == 'function') {
		            call();
		        } else {
		            eval(call);
		        }
		    }, time);
		    if (!ctrlObj.delayinit) {
		        _attachEvent(ctrlObj, 'mouseout', function() {
		            clearTimeout(delayShowST);
		        });
		        ctrlObj.delayinit = 1;
		    }
		}
		var dragMenuDisabled = false;
		function dragMenu(menuObj, e, op) {
		    e = e ? e : window.event;
		    if (op == 1) {
		        if (dragMenuDisabled || in_array(e.target ? e.target.tagName : e.srcElement.tagName, ['TEXTAREA', 'INPUT', 'BUTTON', 'SELECT'])) {
		            return;
		        }
		        JSMENU['drag'] = [e.clientX, e.clientY];
		        JSMENU['drag'][2] = parseInt(menuObj.style.left);
		        JSMENU['drag'][3] = parseInt(menuObj.style.top);
		        document.onmousemove = function(e) {
		            try {
		                dragMenu(menuObj, e, 2);
		            } catch (err) {
		            }
		        };
		        document.onmouseup = function(e) {
		            try {
		                dragMenu(menuObj, e, 3);
		            } catch (err) {
		            }
		        };
		        doane(e);
		    } else if (op == 2 && JSMENU['drag'][0]) {
		        var menudragnow = [e.clientX, e.clientY];
		        menuObj.style.left = (JSMENU['drag'][2] + menudragnow[0] - JSMENU['drag'][0]) + 'px';
		        menuObj.style.top = (JSMENU['drag'][3] + menudragnow[1] - JSMENU['drag'][1]) + 'px';
		        menuObj.removeAttribute('top_');
		        menuObj.removeAttribute('left_');
		        doane(e);
		    } else if (op == 3) {
		        JSMENU['drag'] = [];
		        document.onmousemove = null;
		        document.onmouseup = null;
		    }
		}
		function setMenuPosition(showid, menuid, pos) {
		    var showObj = $(showid);
		    var menuObj = menuid ? $(menuid) : $(showid + '_menu');
		    if (isUndefined(pos) || !pos)
		        pos = '43';
		    var basePoint = parseInt(pos.substr(0, 1));
		    var direction = parseInt(pos.substr(1, 1));
		    var important = pos.indexOf('!') != -1 ? 1 : 0;
		    var sxy = 0, sx = 0, sy = 0, sw = 0, sh = 0, ml = 0, mt = 0, mw = 0, mcw = 0, mh = 0, mch = 0, bpl = 0, bpt = 0;
		    if (!menuObj || (basePoint > 0 && !showObj))
		        return;
		    if (showObj) {
		        sxy = fetchOffset(showObj);
		        sx = sxy['left'];
		        sy = sxy['top'];
		        sw = showObj.offsetWidth;
		        sh = showObj.offsetHeight;
		    }
		    mw = menuObj.offsetWidth;
		    mcw = menuObj.clientWidth;
		    mh = menuObj.offsetHeight;
		    mch = menuObj.clientHeight;
		    switch (basePoint) {
		        case 1:
		            bpl = sx;
		            bpt = sy;
		            break;
		        case 2:
		            bpl = sx + sw;
		            bpt = sy;
		            break;
		        case 3:
		            bpl = sx + sw;
		            bpt = sy + sh;
		            break;
		        case 4:
		            bpl = sx;
		            bpt = sy + sh;
		            break;
		    }
		    switch (direction) {
		        case 0:
		            menuObj.style.left = (document.body.clientWidth - menuObj.clientWidth) / 2 + 'px';
		            mt = (document.documentElement.clientHeight - menuObj.clientHeight) / 2;
		            break;
		        case 1:
		            ml = bpl - mw;
		            mt = bpt - mh;
		            break;
		        case 2:
		            ml = bpl;
		            mt = bpt - mh;
		            break;
		        case 3:
		            ml = bpl;
		            mt = bpt;
		            break;
		        case 4:
		            ml = bpl - mw;
		            mt = bpt;
		            break;
		    }
		    var scrollTop = Math.max(document.documentElement.scrollTop, document.body.scrollTop);
		    var scrollLeft = Math.max(document.documentElement.scrollLeft, document.body.scrollLeft);
		    if (!important) {
		        if (in_array(direction, [1, 4]) && ml < 0) {
		            ml = bpl;
		            if (in_array(basePoint, [1, 4]))
		                ml += sw;
		        } else if (ml + mw > scrollLeft + document.body.clientWidth && sx >= mw) {
		            ml = bpl - mw;
		            if (in_array(basePoint, [2, 3])) {
		                ml -= sw;
		            } else if (basePoint == 4) {
		                ml += sw;
		            }
		        }
		        if (in_array(direction, [1, 2]) && mt < 0) {
		            mt = bpt;
		            if (in_array(basePoint, [1, 2]))
		                mt += sh;
		        } else if (mt + mh > scrollTop + document.documentElement.clientHeight && sy >= mh) {
		            mt = bpt - mh;
		            if (in_array(basePoint, [3, 4]))
		                mt -= sh;
		        }
		    }
		    if (pos.substr(0, 3) == '210') {
		        ml += 69 - sw / 2;
		        mt -= 5;
		        if (showObj.tagName == 'TEXTAREA') {
		            ml -= sw / 2;
		            mt += sh / 2;
		        }
		    }
		    if (direction == 0 || menuObj.scrolly) {
		        if (BROWSER.ie && BROWSER.ie < 7) {
		            if (direction == 0)
		                mt += scrollTop;
		        } else {
		            if (menuObj.scrolly)
		                mt -= scrollTop;
		            menuObj.style.position = 'fixed';
		        }
		    }
		    if (ml)
		        menuObj.style.left = ml + 'px';
		    if (mt)
		        menuObj.style.top = mt + 'px';
		    if (direction == 0 && BROWSER.ie && !document.documentElement.clientHeight) {
		        menuObj.style.position = 'absolute';
		        menuObj.style.top = (document.body.clientHeight - menuObj.clientHeight) / 2 + 'px';
		    }
		    if (menuObj.style.clip && !BROWSER.opera) {
		        menuObj.style.clip = 'rect(auto, auto, auto, auto)';
		    }
		}
		function hideMenu(attr, mtype) {
		    attr = isUndefined(attr) ? '' : attr;
		    mtype = isUndefined(mtype) ? 'menu' : mtype;
		    if (attr == '') {
		        for (var i = 1; i <= JSMENU['layer']; i++) {
		            hideMenu(i, mtype);
		        }
		        return;
		    } else if (typeof attr == 'number') {
		        for (var j in JSMENU['active'][attr]) {
		            hideMenu(JSMENU['active'][attr][j], mtype);
		        }
		        return;
		    } else if (typeof attr == 'string') {
		        var menuObj = $(attr);
		        if (!menuObj || (mtype && menuObj.mtype != mtype))
		            return;
		        var ctrlObj = '', ctrlclass = '';
		        if ((ctrlObj = $(menuObj.getAttribute('ctrlid'))) && (ctrlclass = menuObj.getAttribute('ctrlclass'))) {
		            var reg = new RegExp(' ' + ctrlclass);
		            ctrlObj.className = ctrlObj.className.replace(reg, '');
		        }
		        clearTimeout(JSMENU['timer'][attr]);
		        var hide = function() {
		            if (menuObj.cache) {
		                if (menuObj.style.visibility != 'hidden') {
		                    menuObj.style.display = 'none';
		                    if (menuObj.cover)
		                        $(attr + '_cover').style.display = 'none';
		                }
		            } else {
		                menuObj.parentNode.removeChild(menuObj);
		                if (menuObj.cover)
		                    $(attr + '_cover').parentNode.removeChild($(attr + '_cover'));
		            }
		            var tmp = [];
		            for (var k in JSMENU['active'][menuObj.layer]) {
		                if (attr != JSMENU['active'][menuObj.layer][k])
		                    tmp.push(JSMENU['active'][menuObj.layer][k]);
		            }
		            JSMENU['active'][menuObj.layer] = tmp;
		        };
		        if (menuObj.fade) {
		            var O = 100;
		            var fadeOut = function(O) {
		                if (O == 0) {
		                    clearTimeout(fadeOutTimer);
		                    hide();
		                    return;
		                }
		                menuObj.style.filter = 'progid:DXImageTransform.Microsoft.Alpha(opacity=' + O + ')';
		                menuObj.style.opacity = O / 100;
		                O -= 20;
		                var fadeOutTimer = setTimeout(function() {
		                    fadeOut(O);
		                }, 40);
		            };
		            fadeOut(O);
		        } else {
		            hide();
		        }
		    }
		}
		function getCurrentStyle(obj, cssproperty, csspropertyNS) {
		    if (obj.style[cssproperty]) {
		        return obj.style[cssproperty];
		    }
		    if (obj.currentStyle) {
		        return obj.currentStyle[cssproperty];
		    } else if (document.defaultView.getComputedStyle(obj, null)) {
		        var currentStyle = document.defaultView.getComputedStyle(obj, null);
		        var value = currentStyle.getPropertyValue(csspropertyNS);
		        if (!value) {
		            value = currentStyle[cssproperty];
		        }
		        return value;
		    } else if (window.getComputedStyle) {
		        var currentStyle = window.getComputedStyle(obj, "");
		        return currentStyle.getPropertyValue(csspropertyNS);
		    }
		}
		function fetchOffset(obj, mode) {
		    var left_offset = 0, top_offset = 0, mode = !mode ? 0 : mode;
		    if (obj.getBoundingClientRect && !mode) {
		        var rect = obj.getBoundingClientRect();
		        var scrollTop = Math.max(document.documentElement.scrollTop, document.body.scrollTop);
		        var scrollLeft = Math.max(document.documentElement.scrollLeft, document.body.scrollLeft);
		        if (document.documentElement.dir == 'rtl') {
		            scrollLeft = scrollLeft + document.documentElement.clientWidth - document.documentElement.scrollWidth;
		        }
		        left_offset = rect.left + scrollLeft - document.documentElement.clientLeft;
		        top_offset = rect.top + scrollTop - document.documentElement.clientTop;
		    }
		    if (left_offset <= 0 || top_offset <= 0) {
		        left_offset = obj.offsetLeft;
		        top_offset = obj.offsetTop;
		        while ((obj = obj.offsetParent) != null) {
		            position = getCurrentStyle(obj, 'position', 'position');
		            if (position == 'relative') {
		                continue;
		            }
		            left_offset += obj.offsetLeft;
		            top_offset += obj.offsetTop;
		        }
		    }
		    return {'left': left_offset,'top': top_offset};
		}
		function showTip(ctrlobj) {
		    $F('_showTip', arguments);
		}
		function showPrompt(ctrlid, evt, msg, timeout, classname) {
		    $F('_showPrompt', arguments);
		}
		function showCreditPrompt() {
		    $F('_showCreditPrompt', []);
		}
		var showDialogST = null;
		function showDialog(msg, mode, t, func, cover, funccancel, leftmsg, confirmtxt, canceltxt, closetime, locationtime) {
		    clearTimeout(showDialogST);
		    cover = isUndefined(cover) ? (mode == 'info' ? 0 : 1) : cover;
		    leftmsg = isUndefined(leftmsg) ? '' : leftmsg;
		    mode = in_array(mode, ['confirm', 'notice', 'info', 'right']) ? mode : 'alert';
		    var menuid = 'fwin_dialog';
		    var menuObj = $(menuid);
		    var showconfirm = 1;
		    confirmtxtdefault = '确定';
		    closetime = isUndefined(closetime) ? '' : closetime;
		    closefunc = function() {
		        if (typeof func == 'function')
		            func();
		        else
		            eval(func);
		        hideMenu(menuid, 'dialog');
		    };
		    if (closetime) {
		        showPrompt(null, null, '<i>' + msg + '</i>', closetime * 1000, 'popuptext');
		        return;
		    }
		    locationtime = isUndefined(locationtime) ? '' : locationtime;
		    if (locationtime) {
		        leftmsg = locationtime + ' 秒后页面跳转';
		        showDialogST = setTimeout(closefunc, locationtime * 1000);
		        showconfirm = 0;
		    }
		    confirmtxt = confirmtxt ? confirmtxt : confirmtxtdefault;
		    canceltxt = canceltxt ? canceltxt : '取消';
		    if (menuObj)
		        hideMenu('fwin_dialog', 'dialog');
		    menuObj = document.createElement('div');
		    menuObj.style.display = 'none';
		    menuObj.className = 'fwinmask';
		    menuObj.id = menuid;
		    $('append_parent').appendChild(menuObj);
		    var hidedom = '';
		    if (!BROWSER.ie) {
		        hidedom = '<style type="text/css">object{visibility:hidden;}</style>';
		    }
		    var s = hidedom + '<table cellpadding="0" cellspacing="0" class="fwin"><tr><td class="t_l"></td><td class="t_c"></td><td class="t_r"></td></tr><tr><td class="m_l">&nbsp;&nbsp;</td><td class="m_c"><h3 class="flb"><em>';
		    s += t ? t : '提示信息';
		    s += '</em><span><a href="javascript:;" id="fwin_dialog_close" class="flbc" onclick="hideMenu(\'' + menuid + '\', \'dialog\')" title="关闭">关闭</a></span></h3>';
		    if (mode == 'info') {
		        s += msg ? msg : '';
		    } else {
		        s += '<div class="c altw"><div class="' + (mode == 'alert' ? 'alert_error' : (mode == 'right' ? 'alert_right' : 'alert_info')) + '"><p>' + msg + '</p></div></div>';
		        s += '<p class="o pns">' + (leftmsg ? '<span class="z xg1">' + leftmsg + '</span>' : '') + (showconfirm ? '<button id="fwin_dialog_submit" value="true" class="pn pnc"><strong>' + confirmtxt + '</strong></button>' : '');
		        s += mode == 'confirm' ? '<button id="fwin_dialog_cancel" value="true" class="pn" onclick="hideMenu(\'' + menuid + '\', \'dialog\')"><strong>' + canceltxt + '</strong></button>' : '';
		        s += '</p>';
		    }
		    s += '</td><td class="m_r"></td></tr><tr><td class="b_l"></td><td class="b_c"></td><td class="b_r"></td></tr></table>';
		    menuObj.innerHTML = s;
		    if ($('fwin_dialog_submit'))
		        $('fwin_dialog_submit').onclick = function() {
		            if (typeof func == 'function')
		                func();
		            else
		                eval(func);
		            hideMenu(menuid, 'dialog');
		        };
		    if ($('fwin_dialog_cancel')) {
		        $('fwin_dialog_cancel').onclick = function() {
		            if (typeof funccancel == 'function')
		                funccancel();
		            else
		                eval(funccancel);
		            hideMenu(menuid, 'dialog');
		        };
		        $('fwin_dialog_close').onclick = $('fwin_dialog_cancel').onclick;
		    }
		    showMenu({'mtype': 'dialog','menuid': menuid,'duration': 3,'pos': '00','zindex': JSMENU['zIndex']['dialog'],'cache': 0,'cover': cover});
		    try {
		        if ($('fwin_dialog_submit'))
		            $('fwin_dialog_submit').focus();
		    } catch (e) {
		    }
		}
		function showWindow(k, url, mode, cache, menuv) {
		    mode = isUndefined(mode) ? 'get' : mode;
		    cache = isUndefined(cache) ? 1 : cache;
		    var menuid = 'fwin_' + k;
		    var menuObj = $(menuid);
		    var drag = null;
		    var loadingst = null;
		    var hidedom = '';
		    if (disallowfloat && disallowfloat.indexOf(k) != -1) {
		        if (BROWSER.ie)
		            url += (url.indexOf('?') != -1 ? '&' : '?') + 'referer=' + escape(location.href);
		        location.href = url;
		        doane();
		        return;
		    }
		    var fetchContent = function() {
		        if (mode == 'get') {
		            menuObj.url = url;
		            url += (url.search(/\?/) > 0 ? '&' : '?') + 'infloat=yes&handlekey=' + k;
		            url += cache == -1 ? '&t=' + (+new Date()) : '';
		            if (BROWSER.ie && url.indexOf('referer=') < 0) {
		                url = url + '&referer=' + encodeURIComponent(location);
		            }
		            ajaxget(url, 'fwin_content_' + k, null, '', '', function() {
		                initMenu();
		                show();
		            });
		        } else if (mode == 'post') {
		            menuObj.act = $(url).action;
		            ajaxpost(url, 'fwin_content_' + k, '', '', '', function() {
		                initMenu();
		                show();
		            });
		        }
		        if (parseInt(BROWSER.ie) != 6) {
		            loadingst = setTimeout(function() {
		                showDialog('', 'info', '<img src="' + IMGDIR + '/loading.gif"> 请稍候...')
		            }, 500);
		        }
		    };
		    var initMenu = function() {
		        clearTimeout(loadingst);
		        var objs = menuObj.getElementsByTagName('*');
		        var fctrlidinit = false;
		        for (var i = 0; i < objs.length; i++) {
		            if (objs[i].id) {
		                objs[i].setAttribute('fwin', k);
		            }
		            if (objs[i].className == 'flb' && !fctrlidinit) {
		                if (!objs[i].id)
		                    objs[i].id = 'fctrl_' + k;
		                drag = objs[i].id;
		                fctrlidinit = true;
		            }
		        }
		    };
		    var show = function() {
		        hideMenu('fwin_dialog', 'dialog');
		        v = {'mtype': 'win','menuid': menuid,'duration': 3,'pos': '00','zindex': JSMENU['zIndex']['win'],'drag': typeof drag == null ? '' : drag,'cache': cache};
		        for (k in menuv) {
		            v[k] = menuv[k];
		        }
		        showMenu(v);
		    };
		    if (!menuObj) {
		        menuObj = document.createElement('div');
		        menuObj.id = menuid;
		        menuObj.className = 'fwinmask';
		        menuObj.style.display = 'none';
		        $('append_parent').appendChild(menuObj);
		        evt = ' style="cursor:move" onmousedown="dragMenu($(\'' + menuid + '\'), event, 1)" ondblclick="hideWindow(\'' + k + '\')"';
		        if (!BROWSER.ie) {
		            hidedom = '<style type="text/css">object{visibility:hidden;}</style>';
		        }
		        menuObj.innerHTML = hidedom + '<table cellpadding="0" cellspacing="0" class="fwin"><tr><td class="t_l"></td><td class="t_c"' + evt + '></td><td class="t_r"></td></tr><tr><td class="m_l"' + evt + ')">&nbsp;&nbsp;</td><td class="m_c" id="fwin_content_' + k + '">' + '</td><td class="m_r"' + evt + '"></td></tr><tr><td class="b_l"></td><td class="b_c"' + evt + '></td><td class="b_r"></td></tr></table>';
		        if (mode == 'html') {
		            $('fwin_content_' + k).innerHTML = url;
		            initMenu();
		            show();
		        } else {
		            fetchContent();
		        }
		    } else if ((mode == 'get' && (url != menuObj.url || cache != 1)) || (mode == 'post' && $(url).action != menuObj.act)) {
		        fetchContent();
		    } else {
		        show();
		    }
		    doane();
		}
		function showError(msg) {
		    var p = /<script[^\>]*?>([^\x00]*?)<\/script>/ig;
		    msg = msg.replace(p, '');
		    if (msg !== '') {
		        showDialog(msg, 'alert', '错误信息', null, true, null, '', '', '', 3);
		    }
		}
		function hideWindow(k, all, clear) {
		    all = isUndefined(all) ? 1 : all;
		    clear = isUndefined(clear) ? 1 : clear;
		    hideMenu('fwin_' + k, 'win');
		    if (clear && $('fwin_' + k)) {
		        $('append_parent').removeChild($('fwin_' + k));
		    }
		    if (all) {
		        hideMenu();
		    }
		}
		function AC_FL_RunContent() {
		    var str = '';
		    var ret = AC_GetArgs(arguments, "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000", "application/x-shockwave-flash");
		    if (BROWSER.ie && !BROWSER.opera) {
		        str += '<object ';
		        for (var i in ret.objAttrs) {
		            str += i + '="' + ret.objAttrs[i] + '" ';
		        }
		        str += '>';
		        for (var i in ret.params) {
		            str += '<param name="' + i + '" value="' + ret.params[i] + '" /> ';
		        }
		        str += '</object>';
		    } else {
		        str += '<embed ';
		        for (var i in ret.embedAttrs) {
		            str += i + '="' + ret.embedAttrs[i] + '" ';
		        }
		        str += '></embed>';
		    }
		    return str;
		}
		function AC_GetArgs(args, classid, mimeType) {
		    var ret = new Object();
		    ret.embedAttrs = new Object();
		    ret.params = new Object();
		    ret.objAttrs = new Object();
		    for (var i = 0; i < args.length; i = i + 2) {
		        var currArg = args[i].toLowerCase();
		        switch (currArg) {
		            case "classid":
		                break;
		            case "pluginspage":
		                ret.embedAttrs[args[i]] = 'http://www.macromedia.com/go/getflashplayer';
		                break;
		            case "src":
		                ret.embedAttrs[args[i]] = args[i + 1];
		                ret.params["movie"] = args[i + 1];
		                break;
		            case "codebase":
		                ret.objAttrs[args[i]] = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0';
		                break;
		            case "onafterupdate":
		            case "onbeforeupdate":
		            case "onblur":
		            case "oncellchange":
		            case "onclick":
		            case "ondblclick":
		            case "ondrag":
		            case "ondragend":
		            case "ondragenter":
		            case "ondragleave":
		            case "ondragover":
		            case "ondrop":
		            case "onfinish":
		            case "onfocus":
		            case "onhelp":
		            case "onmousedown":
		            case "onmouseup":
		            case "onmouseover":
		            case "onmousemove":
		            case "onmouseout":
		            case "onkeypress":
		            case "onkeydown":
		            case "onkeyup":
		            case "onload":
		            case "onlosecapture":
		            case "onpropertychange":
		            case "onreadystatechange":
		            case "onrowsdelete":
		            case "onrowenter":
		            case "onrowexit":
		            case "onrowsinserted":
		            case "onstart":
		            case "onscroll":
		            case "onbeforeeditfocus":
		            case "onactivate":
		            case "onbeforedeactivate":
		            case "ondeactivate":
		            case "type":
		            case "id":
		                ret.objAttrs[args[i]] = args[i + 1];
		                break;
		            case "width":
		            case "height":
		            case "align":
		            case "vspace":
		            case "hspace":
		            case "class":
		            case "title":
		            case "accesskey":
		            case "name":
		            case "tabindex":
		                ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i + 1];
		                break;
		            default:
		                ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i + 1];
		        }
		    }
		    ret.objAttrs["classid"] = classid;
		    if (mimeType) {
		        ret.embedAttrs["type"] = mimeType;
		    }
		    return ret;
		}
		function simulateSelect(selectId, widthvalue) {
		    var selectObj = $(selectId);
		    if (!selectObj)
		        return;
		    if (BROWSER.other) {
		        if (selectObj.getAttribute('change')) {
		            selectObj.onchange = function() {
		                eval(selectObj.getAttribute('change'));
		            }
		        }
		        return;
		    }
		    var widthvalue = widthvalue ? widthvalue : 70;
		    var defaultopt = selectObj.options[0] ? selectObj.options[0].innerHTML : '';
		    var defaultv = '';
		    var menuObj = document.createElement('div');
		    var ul = document.createElement('ul');
		    var handleKeyDown = function(e) {
		        e = BROWSER.ie ? event : e;
		        if (e.keyCode == 40 || e.keyCode == 38)
		            doane(e);
		    };
		    var selectwidth = (selectObj.getAttribute('width', i) ? selectObj.getAttribute('width', i) : widthvalue) + 'px';
		    var tabindex = selectObj.getAttribute('tabindex', i) ? selectObj.getAttribute('tabindex', i) : 1;
		    for (var i = 0; i < selectObj.options.length; i++) {
		        var li = document.createElement('li');
		        li.innerHTML = selectObj.options[i].innerHTML;
		        li.k_id = i;
		        li.k_value = selectObj.options[i].value;
		        if (selectObj.options[i].selected) {
		            defaultopt = selectObj.options[i].innerHTML;
		            defaultv = selectObj.options[i].value;
		            li.className = 'current';
		            selectObj.setAttribute('selecti', i);
		        }
		        li.onclick = function() {
		            if ($(selectId + '_ctrl').innerHTML != this.innerHTML) {
		                var lis = menuObj.getElementsByTagName('li');
		                lis[$(selectId).getAttribute('selecti')].className = '';
		                this.className = 'current';
		                $(selectId + '_ctrl').innerHTML = this.innerHTML;
		                $(selectId).setAttribute('selecti', this.k_id);
		                $(selectId).options.length = 0;
		                $(selectId).options[0] = new Option('', this.k_value);
		                eval(selectObj.getAttribute('change'));
		            }
		            hideMenu(menuObj.id);
		            return false;
		        };
		        ul.appendChild(li);
		    }
		    selectObj.options.length = 0;
		    selectObj.options[0] = new Option('', defaultv);
		    selectObj.style.display = 'none';
		    selectObj.outerHTML += '<a href="javascript:;" id="' + selectId + '_ctrl" style="width:' + selectwidth + '" tabindex="' + tabindex + '">' + defaultopt + '</a>';
		    menuObj.id = selectId + '_ctrl_menu';
		    menuObj.className = 'sltm';
		    menuObj.style.display = 'none';
		    menuObj.style.width = selectwidth;
		    menuObj.appendChild(ul);
		    $('append_parent').appendChild(menuObj);
		    $(selectId + '_ctrl').onclick = function(e) {
		        $(selectId + '_ctrl_menu').style.width = selectwidth;
		        showMenu({'ctrlid': (selectId == 'loginfield' ? 'account' : selectId + '_ctrl'),'menuid': selectId + '_ctrl_menu','evt': 'click','pos': '43'});
		        doane(e);
		    };
		    $(selectId + '_ctrl').onfocus = menuObj.onfocus = function() {
		        _attachEvent(document.body, 'keydown', handleKeyDown);
		    };
		    $(selectId + '_ctrl').onblur = menuObj.onblur = function() {
		        _detachEvent(document.body, 'keydown', handleKeyDown);
		    };
		    $(selectId + '_ctrl').onkeyup = function(e) {
		        e = e ? e : window.event;
		        value = e.keyCode;
		        if (value == 40 || value == 38) {
		            if (menuObj.style.display == 'none') {
		                $(selectId + '_ctrl').onclick();
		            } else {
		                lis = menuObj.getElementsByTagName('li');
		                selecti = selectObj.getAttribute('selecti');
		                lis[selecti].className = '';
		                if (value == 40) {
		                    selecti = parseInt(selecti) + 1;
		                } else if (value == 38) {
		                    selecti = parseInt(selecti) - 1;
		                }
		                if (selecti < 0) {
		                    selecti = lis.length - 1
		                } else if (selecti > lis.length - 1) {
		                    selecti = 0;
		                }
		                lis[selecti].className = 'current';
		                selectObj.setAttribute('selecti', selecti);
		                lis[selecti].parentNode.scrollTop = lis[selecti].offsetTop;
		            }
		        } else if (value == 13) {
		            var lis = menuObj.getElementsByTagName('li');
		            lis[selectObj.getAttribute('selecti')].onclick();
		        } else if (value == 27) {
		            hideMenu(menuObj.id);
		        }
		    };
		}
		function switchTab(prefix, current, total, activeclass) {
		    $F('_switchTab', arguments);
		}
		function imageRotate(imgid, direct) {
		    $F('_imageRotate', arguments);
		}
		function thumbImg(obj, method) {
		    if (!obj) {
		        return;
		    }
		    obj.onload = null;
		    file = obj.src;
		    zw = obj.offsetWidth;
		    zh = obj.offsetHeight;
		    if (zw < 2) {
		        if (!obj.id) {
		            obj.id = 'img_' + Math.random();
		        }
		        setTimeout("thumbImg($('" + obj.id + "'), " + method + ")", 100);
		        return;
		    }
		    zr = zw / zh;
		    method = !method ? 0 : 1;
		    if (method) {
		        fixw = obj.getAttribute('_width');
		        fixh = obj.getAttribute('_height');
		        if (zw > fixw) {
		            zw = fixw;
		            zh = zw / zr;
		        }
		        if (zh > fixh) {
		            zh = fixh;
		            zw = zh * zr;
		        }
		    } else {
		        fixw = typeof imagemaxwidth == 'undefined' ? '600' : imagemaxwidth;
		        if (zw > fixw) {
		            zw = fixw;
		            zh = zw / zr;
		            obj.style.cursor = 'pointer';
		            if (!obj.onclick) {
		                obj.onclick = function() {
		                    zoom(obj, obj.src);
		                };
		            }
		        }
		    }
		    obj.width = zw;
		    obj.height = zh;
		}
		var zoomstatus = 1;
		function zoom(obj, zimg, nocover, pn, showexif) {
		    $F('_zoom', arguments);
		}
		function showselect(obj, inpid, t, rettype) {
		    $F('_showselect', arguments);
		}
		function showColorBox(ctrlid, layer, k, bgcolor) {
		    $F('_showColorBox', arguments);
		}
		function ctrlEnter(event, btnId, onlyEnter) {
		    if (isUndefined(onlyEnter))
		        onlyEnter = 0;
		    if ((event.ctrlKey || onlyEnter) && event.keyCode == 13) {
		        $(btnId).click();
		        return false;
		    }
		    return true;
		}
		function parseurl(str, mode, parsecode) {
		    if (isUndefined(parsecode))
		        parsecode = true;
		    if (parsecode)
		        str = str.replace(/\s*\[code\]([\s\S]+?)\[\/code\]\s*/ig, function($1, $2) {
		            return codetag($2, -1);
		        });
		    str = str.replace(/([^>=\]"'\/]|^)((((https?|ftp):\/\/)|www\.)([\w\-]+\.)*[\w\-\u4e00-\u9fa5]+\.([\.a-zA-Z0-9]+|\u4E2D\u56FD|\u7F51\u7EDC|\u516C\u53F8)((\?|\/|:)+[\w\.\/=\?%\-&~`@':+!]*)+\.(swf|flv))/ig, '$1[flash]$2[/flash]');
		    str = str.replace(/([^>=\]"'\/]|^)((((https?|ftp):\/\/)|www\.)([\w\-]+\.)*[\w\-\u4e00-\u9fa5]+\.([\.a-zA-Z0-9]+|\u4E2D\u56FD|\u7F51\u7EDC|\u516C\u53F8)((\?|\/|:)+[\w\.\/=\?%\-&~`@':+!]*)+\.(mp3|wma))/ig, '$1[audio]$2[/audio]');
		    str = str.replace(/([^>=\]"'\/@]|^)((((https?|ftp|gopher|news|telnet|rtsp|mms|callto|bctp|ed2k|thunder|qqdl|synacast):\/\/))([\w\-]+\.)*[:\.@\-\w\u4e00-\u9fa5]+\.([\.a-zA-Z0-9]+|\u4E2D\u56FD|\u7F51\u7EDC|\u516C\u53F8)((\?|\/|:)+[\w\.\/=\?%\-&;~`@':+!#]*)*)/ig, mode == 'html' ? '$1<a href="$2" target="_blank">$2</a>' : '$1[url]$2[/url]');
		    str = str.replace(/([^\w>=\]"'\/@]|^)((www\.)([\w\-]+\.)*[:\.@\-\w\u4e00-\u9fa5]+\.([\.a-zA-Z0-9]+|\u4E2D\u56FD|\u7F51\u7EDC|\u516C\u53F8)((\?|\/|:)+[\w\.\/=\?%\-&;~`@':+!#]*)*)/ig, mode == 'html' ? '$1<a href="$2" target="_blank">$2</a>' : '$1[url]$2[/url]');
		    str = str.replace(/([^\w->=\]:"'\.\/]|^)(([\-\.\w]+@[\.\-\w]+(\.\w+)+))/ig, mode == 'html' ? '$1<a href="mailto:$2">$2</a>' : '$1[email]$2[/email]');
		    if (parsecode) {
		        for (var i = 0; i <= DISCUZCODE['num']; i++) {
		            str = str.replace("[\tDISCUZ_CODE_" + i + "\t]", DISCUZCODE['html'][i]);
		        }
		    }
		    return str;
		}
		function codetag(text, br) {
		    var br = !br ? 1 : br;
		    DISCUZCODE['num']++;
		    if (br > 0 && typeof wysiwyg != 'undefined' && wysiwyg)
		        text = text.replace(/<br[^\>]*>/ig, '\n');
		    text = text.replace(/\$/ig, '$$');
		    DISCUZCODE['html'][DISCUZCODE['num']] = '[code]' + text + '[/code]';
		    return '[\tDISCUZ_CODE_' + DISCUZCODE['num'] + '\t]';
		}
		function saveUserdata(name, data) {
		    try {
		        if (window.localStorage) {
		            localStorage.setItem('Discuz_' + name, data);
		        } else if (window.sessionStorage) {
		            sessionStorage.setItem('Discuz_' + name, data);
		        }
		    } catch (e) {
		        if (BROWSER.ie) {
		            if (data.length < 54889) {
		                with (document.documentElement) {
		                    setAttribute("value", data);
		                    save('Discuz_' + name);
		                }
		            }
		        }
		    }
		    setcookie('clearUserdata', '', -1);
		}
		function loadUserdata(name) {
		    if (window.localStorage) {
		        return localStorage.getItem('Discuz_' + name);
		    } else if (window.sessionStorage) {
		        return sessionStorage.getItem('Discuz_' + name);
		    } else if (BROWSER.ie) {
		        with (document.documentElement) {
		            load('Discuz_' + name);
		            return getAttribute("value");
		        }
		    }
		}
		function initTab(frameId, type) {
		    $F('_initTab', arguments);
		}
		function openDiy() {
		    if (DYNAMICURL) {
		        window.location.href = SITEURL + DYNAMICURL + (DYNAMICURL.indexOf('?') < 0 ? '?' : '&') + ('diy=yes');
		    } else {
		        window.location.href = ((window.location.href + '').replace(/[\?\&]diy=yes/g, '').split('#')[0] + (window.location.search && window.location.search.indexOf('?diy=yes') < 0 ? '&diy=yes' : '?diy=yes'));
		    }
		}
		function hasClass(elem, className) {
		    return elem.className && (" " + elem.className + " ").indexOf(" " + className + " ") != -1;
		}
		function runslideshow() {
		    $F('_runslideshow', []);
		}
		function toggle_collapse(objname, noimg, complex, lang) {
		    $F('_toggle_collapse', arguments);
		}
		function updatestring(str1, str2, clear) {
		    str2 = '_' + str2 + '_';
		    return clear ? str1.replace(str2, '') : (str1.indexOf(str2) == -1 ? str1 + str2 : str1);
		}
		function getClipboardData() {
		    window.document.clipboardswf.SetVariable('str', CLIPBOARDSWFDATA);
		}
		function setCopy(text, msg) {
		    $F('_setCopy', arguments);
		}
		function copycode(obj) {
		    $F('_copycode', arguments);
		}
		function showdistrict(container, elems, totallevel, changelevel, containertype) {
		    $F('_showdistrict', arguments);
		}
		function setDoodle(fid, oid, url, tid, from) {
		    $F('_setDoodle', arguments);
		}
		function initSearchmenu(searchform, cloudSearchUrl) {
		    var defaultUrl = 'search.php?searchsubmit=yes';
		    if (typeof cloudSearchUrl == "undefined" || cloudSearchUrl == null || cloudSearchUrl == '') {
		        cloudSearchUrl = defaultUrl;
		    }
		    var searchtxt = $(searchform + '_txt');
		    if (!searchtxt) {
		        searchtxt = $(searchform);
		    }
		    var tclass = searchtxt.className;
		    searchtxt.className = tclass + ' xg1';
		    if (!!("placeholder" in document.createElement("input"))) {
		        if (searchtxt.value == '请输入搜索内容') {
		            searchtxt.value = '';
		        }
		    } else {
		        searchtxt.onfocus = function() {
		            if (searchtxt.value == '请输入搜索内容') {
		                searchtxt.value = '';
		                searchtxt.className = tclass;
		            }
		        };
		        searchtxt.onblur = function() {
		            if (searchtxt.value == '') {
		                searchtxt.className = tclass + ' xg1';
		            }
		        };
		    }
		    if (!$(searchform + '_type_menu'))
		        return false;
		    var o = $(searchform + '_type');
		    var a = $(searchform + '_type_menu').getElementsByTagName('a');
		    var formobj = searchtxt.form;
		    for (var i = 0; i < a.length; i++) {
		        if (a[i].className == 'curtype') {
		            o.innerHTML = a[i].innerHTML;
		            $(searchform + '_mod').value = a[i].rel;
		            formobj.method = 'post';
		            if ((a[i].rel == 'forum' || a[i].rel == 'curforum') && defaultUrl != cloudSearchUrl) {
		                formobj.action = cloudSearchUrl;
		                formobj.method = 'get';
		                if ($('srchFId')) {
		                    $('srchFId').value = a[i].rel == 'forum' ? 0 : a[i].getAttribute('fid');
		                }
		            } else {
		                formobj.action = defaultUrl;
		            }
		        }
		        a[i].onclick = function() {
		            o.innerHTML = this.innerHTML;
		            $(searchform + '_mod').value = this.rel;
		            formobj.method = 'post';
		            if ((this.rel == 'forum' || this.rel == 'curforum') && defaultUrl != cloudSearchUrl) {
		                formobj.action = cloudSearchUrl;
		                formobj.method = 'get';
		                if ($('srchFId')) {
		                    $('srchFId').value = this.rel == 'forum' ? 0 : this.getAttribute('fid');
		                }
		            } else {
		                formobj.action = defaultUrl;
		            }
		        };
		    }
		}
		function searchFocus(obj) {
		    if (obj.value == '请输入搜索内容') {
		        obj.value = '';
		    }
		    if ($('cloudsearchquery') != null) {
		        $('cloudsearchquery').value = obj.value;
		    }
		}
		function extstyle(css) {
		    $F('_extstyle', arguments);
		}
		function widthauto(obj) {
		    $F('_widthauto', arguments);
		}
		var secST = new Array();
		function updatesecqaa(idhash) {
		    $F('_updatesecqaa', arguments);
		}
		function updateseccode(idhash, play) {
		    $F('_updateseccode', arguments);
		}
		function checksec(type, idhash, showmsg, recall) {
		    $F('_checksec', arguments);
		}
		function createPalette(colorid, id, func) {
		    $F('_createPalette', arguments);
		}
		function showForummenu(fid) {
		    $F('_showForummenu', arguments);
		}
		function showUserApp() {
		    $F('_showUserApp', arguments);
		}
		function cardInit() {
		    var cardShow = function(obj) {
		        if (BROWSER.ie && BROWSER.ie < 7 && obj.href.indexOf('username') != -1) {
		            return;
		        }
		        pos = obj.getAttribute('c') == '1' ? '43' : obj.getAttribute('c');
		        USERCARDST = setTimeout(function() {
		            ajaxmenu(obj, 500, 1, 2, pos, null, 'p_pop card');
		        }, 250);
		    };
		    var cardids = {};
		    var a = document.body.getElementsByTagName('a');
		    for (var i = 0; i < a.length; i++) {
		        if (a[i].getAttribute('c')) {
		            var href = a[i].getAttribute('href', 1);
		            if (typeof cardids[href] == 'undefined') {
		                cardids[href] = Math.round(Math.random() * 10000);
		            }
		            a[i].setAttribute('mid', 'card_' + cardids[href]);
		            a[i].onmouseover = function() {
		                cardShow(this)
		            };
		            a[i].onmouseout = function() {
		                clearTimeout(USERCARDST);
		            };
		        }
		    }
		}
		function navShow(id) {
		    var mnobj = $('snav_mn_' + id);
		    if (!mnobj) {
		        return;
		    }
		    var uls = $('mu').getElementsByTagName('ul');
		    for (i = 0; i < uls.length; i++) {
		        if (uls[i].className != 'cl current') {
		            uls[i].style.display = 'none';
		        }
		    }
		    if (mnobj.className != 'cl current') {
		        showMenu({'ctrlid': 'mn_' + id,'menuid': 'snav_mn_' + id,'pos': '*'});
		        mnobj.className = 'cl floatmu';
		        mnobj.style.width = ($('nv').clientWidth) + 'px';
		        mnobj.style.display = '';
		    }
		}
		function strLenCalc(obj, checklen, maxlen) {
		    var v = obj.value, charlen = 0, maxlen = !maxlen ? 300 : maxlen, curlen = maxlen, len = strlen(v);
		    for (var i = 0; i < v.length; i++) {
		        if (v.charCodeAt(i) < 0 || v.charCodeAt(i) > 255) {
		            curlen -= charset == 'utf-8' ? 2 : 1;
		        }
		    }
		    if (curlen >= len) {
		        $(checklen).innerHTML = curlen - len;
		    } else {
		        obj.value = mb_cutstr(v, maxlen, 0);
		    }
		}
		function patchNotice() {
		    if ($('patch_notice')) {
		        ajaxget('misc.php?mod=patch&action=patchnotice', 'patch_notice', '');
		    }
		}
		function pluginNotice() {
		    if ($('plugin_notice')) {
		        ajaxget('misc.php?mod=patch&action=pluginnotice', 'plugin_notice', '');
		    }
		}
		function ipNotice() {
		    if ($('ip_notice')) {
		        ajaxget('misc.php?mod=patch&action=ipnotice&_r=' + Math.random(), 'ip_notice', '');
		    }
		}
		function noticeTitle() {
		    NOTICETITLE = {'State': 0,'oldTitle': NOTICECURTITLE,flashNumber: 0,sleep: 15};
		    if (!getcookie('noticeTitle')) {
		        window.setInterval('noticeTitleFlash();', 500);
		    } else {
		        window.setTimeout('noticeTitleFlash();', 500);
		    }
		    setcookie('noticeTitle', 1, 600);
		}
		function noticeTitleFlash() {
		    if (NOTICETITLE.flashNumber < 5 || NOTICETITLE.flashNumber > 4 && !NOTICETITLE['State']) {
		        document.title = (NOTICETITLE['State'] ? '【　　　】' : '【新提醒】') + NOTICETITLE['oldTitle'];
		        NOTICETITLE['State'] = !NOTICETITLE['State'];
		    }
		    NOTICETITLE.flashNumber = NOTICETITLE.flashNumber < NOTICETITLE.sleep ? ++NOTICETITLE.flashNumber : 0;
		}
		function relatedlinks(rlinkmsgid) {
		    $F('_relatedlinks', arguments);
		}
		function con_handle_response(response) {
		    return response;
		}
		function showTopLink() {
		    var ft = $('ft');
		    if (ft) {
		        var scrolltop = $('scrolltop');
		        var viewPortHeight = parseInt(document.documentElement.clientHeight);
		        var scrollHeight = parseInt(document.body.getBoundingClientRect().top);
		        var basew = parseInt(ft.clientWidth);
		        var sw = scrolltop.clientWidth;
		        if (basew < 1500) {
		            var left = parseInt(fetchOffset(ft)['left']);
		            left = left < sw ? left * 2 - sw : left;
		            scrolltop.style.left = (basew + left) + 'px';
		        } else {
		            scrolltop.style.left = 'auto';
		            scrolltop.style.right = 0;
		        }
		        if (BROWSER.ie && BROWSER.ie < 7) {
		            scrolltop.style.top = viewPortHeight - scrollHeight - 150 + 'px';
		        }
		        if (scrollHeight < -100) {
		            scrolltop.style.visibility = 'visible';
		        } else {
		            scrolltop.style.visibility = 'hidden';
		        }
		    }
		}
		function showCreditmenu() {
		    $F('_showCreditmenu', []);
		}
		function showUpgradeinfo() {
		    $F('_showUpgradeinfo', []);
		}
		function addFavorite(url, title) {
		    try {
		        window.external.addFavorite(url, title);
		    } catch (e) {
		        try {
		            window.sidebar.addPanel(title, url, '');
		        } catch (e) {
		            showDialog("请按 Ctrl+D 键添加到收藏夹", 'notice');
		        }
		    }
		}
		function setHomepage(sURL) {
		    if (BROWSER.ie) {
		        document.body.style.behavior = 'url(#default#homepage)';
		        document.body.setHomePage(sURL);
		    } else {
		        showDialog("非 IE 浏览器请手动将本站设为首页", 'notice');
		        doane();
		    }
		}
		function setShortcut() {
		    var scrollTop = Math.max(document.documentElement.scrollTop, document.body.scrollTop);
		    if (!loadUserdata('setshortcut') && !scrollTop) {
		        $F('_setShortcut', []);
		    }
		}
		function smilies_show(id, smcols, seditorkey) {
		    $F('_smilies_show', arguments, 'smilies');
		}
		function showfocus(ftype, autoshow) {
		    var id = parseInt($('focuscur').innerHTML);
		    if (ftype == 'prev') {
		        id = (id - 1) < 1 ? focusnum : (id - 1);
		        if (!autoshow) {
		            window.clearInterval(focusautoshow);
		        }
		    } else if (ftype == 'next') {
		        id = (id + 1) > focusnum ? 1 : (id + 1);
		        if (!autoshow) {
		            window.clearInterval(focusautoshow);
		        }
		    }
		    $('focuscur').innerHTML = id;
		    $('focus_con').innerHTML = $('focus_' + (id - 1)).innerHTML;
		}
		function rateStarHover(target, level) {
		    if (level == 0) {
		        $(target).style.width = '';
		    } else {
		        $(target).style.width = level * 16 + 'px';
		    }
		}
		function rateStarSet(target, level, input) {
		    $(input).value = level;
		    $(target).className = 'star star' + level;
		}
		function img_onmouseoverfunc(obj) {
		    if (typeof showsetcover == 'function') {
		        showsetcover(obj);
		    }
		    return;
		}
		function toggleBlind(dom) {
		    if (dom) {
		        if (loadUserdata('is_blindman')) {
		            saveUserdata('is_blindman', '');
		            dom.title = '开启辅助访问';
		        } else {
		            saveUserdata('is_blindman', '1');
		            dom.title = '关闭辅助访问';
		        }
		    }
		}
		function checkBlind() {
		    var dom = $('switchblind');
		    if (dom) {
		        if (loadUserdata('is_blindman')) {
		            dom.title = '关闭辅助访问';
		        } else {
		            dom.title = '开启辅助访问';
		        }
		    }
		}
		function getElementOffset(element) {
		    var left = element.offsetLeft, top = element.offsetTop;
		    while (element = element.offsetParent) {
		        left += element.offsetLeft;
		        top += element.offsetTop;
		    }
		    if ($('nv').style.position == 'fixed') {
		        top -= parseInt($('nv').style.height);
		    }
		    return {'left': left,'top': top};
		}
		function mobileplayer() {
		    var platform = navigator.platform;
		    var ua = navigator.userAgent;
		    var ios = /iPhone|iPad|iPod/.test(platform) && ua.indexOf("AppleWebKit") > -1;
		    var andriod = ua.indexOf("Android") > -1;
		    if (ios || andriod) {
		        return true;
		    } else {
		        return false;
		    }
		}
		if (typeof IN_ADMINCP == 'undefined') {
		    if (creditnotice != '' && getcookie('creditnotice')) {
		        _attachEvent(window, 'load', showCreditPrompt, document);
		    }
		    if (typeof showusercard != 'undefined' && showusercard == 1) {
		        _attachEvent(window, 'load', cardInit, document);
		    }
		}
		if (BROWSER.ie) {
		    document.documentElement.addBehavior("#default#userdata");
		}
		function show_pop_menu(o, options) {
		    if (!o || !o.id || !$(o.id + '_box'))
		        return;
		    var box = $(o.id + '_box');
		    options = options || {};
		    options.offset_x = options.offset_x || 10;
		    options.offset_y = options.offset_y || 0;
		    options.float = options.float || 'right';
		    options.class_self = typeof options.class_self == 'undefined' ? false : options.class_self;
		    var pos = fetchOffset(o), sz1 = element_size(o), sz2 = element_size(box);
		    if (pos && sz1.width && sz2.width && sz1.height) {
		        var lf = pos.left + (options.float == 'right' ? sz1.width - sz2.width : 0) + options.offset_x, tp = pos.top + sz1.height;
		        lf && (box.style.left = lf + 'px');
		        tp && (box.style.top = tp + 'px');
		    }
		    box.onmouseover || (box.onmouseover = function() {
		        o.setAttribute('status', 1);
		    });
		    box.onmouseout || (box.onmouseout = function() {
		        o.setAttribute('status', 0), o.timer && clearTimeout(o.timer);
		        o.timer = setTimeout(function() {
		            o.getAttribute('status') == '0' && (box.style.display = 'none');
		        }, 200);
		    });
		    box.style.position = 'absolute';
		    box.style.display = 'block';
		    o.setAttribute('status', 1);
		    options.class_self !== false && (o.className = options.class_self);
		}
		function hide_pop_menu(o, options) {
		    if (!o || !o.id || !$(o.id + '_box'))
		        return;
		    options = options || {};
		    options.class_self = typeof options.class_self == 'undefined' ? false : options.class_self;
		    var box = $(o.id + '_box');
		    o.setAttribute('status', 0), o.timer && clearTimeout(o.timer);
		    if (eventRelatedTarget() == box) {
		        o.timer = setTimeout(function() {
		            o.getAttribute('status') == '0' && (box.style.display = 'none');
		        }, 200);
		    } else {
		        box.style.display = 'none';
		    }
		    options.class_self !== false && (o.className = options.class_self);
		}
		function element_size(node) {
		    if (!node || node.nodeType != 1)
		        return {width: 0,height: 0};
		    var sz;
		    getCurrentStyle(node, 'display') == 'none' ? (node.style.visibility = 'hidden', node.style.position = 'absolute', node.style.display = 'block', sz = {width: parseInt(node.offsetWidth),height: parseInt(node.offsetHeight)}, node.style.display = 'none', node.style.position = '', node.style.visibility = '') : (sz = {width: parseInt(node.offsetWidth),height: parseInt(node.offsetHeight)});
		    sz.width = isFinite(sz.width) ? sz.width : 0;
		    sz.height = isFinite(sz.height) ? sz.height : 0;
		    return sz;
		}
		function eventRelatedTarget() {
		    var e = getEvent();
		    var o = e.relatedTarget ? e.relatedTarget : e.type == 'mouseout' ? e.toElement : e.fromElement;
		    return o;
		}
		function cshare(t, title_val, url_val, pic_val) {
		    t = jQuery(t);
		    title_val = encodeURIComponent(title_val || document.title);
		    url_val = url_val || location.href;
		    if (url_val.substring(0, 4) != "http") {
		        url_val = "http://bbs.coloros.com/" + url_val;
		    }
		    var d = jQuery('#share_div');
		    if (d.length == 0) {
		        d = jQuery('<div id="share_div"></div>').appendTo('body').mouseleave(function() {
		            jQuery(this).hide();
		        });
		        jQuery('<a id="weibo" class="share_weibo" href="http://service.weibo.com/share/share.php?appkey=3036938102&ralateUid=3402761920&amp;url=' + url_val + '&amp;pic=' + pic_val + '" target="_blank">新浪微博</a>' + '<a id="qq" class="share_qq"  href="http://connect.qq.com/widget/shareqq/index.html?url=' + url_val + '&amp;pics=' + pic_val + '&amp;site=ColorOS社区&amp;title=' + title_val + '" target="_blank">QQ好友</a>' + '<a id="qzone" class="share_qzone" href="http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=' + url_val + '&pics=' + pic_val + '" target="_blank">QQ空间</a>').appendTo(d);
		        jQuery('<a id="weixin" class="share_weixin" href="http://s.jiathis.com/qrcode.php?url=' + url_val + '">微信</a>').click(function() {
		            showDialog('<img src="' + jQuery(this).attr('href') + '" style="margin: 0px auto 10px;display: block;"/>', 'info', '分享到微信朋友圈');
		            return false;
		        }).appendTo(d);
		        jQuery('<a id="renren" class="share_renren" href="http://share.renren.com/share/buttonshare.do?link=' + url_val + '&amp;title=' + title_val + '" target="_blank">人人网</a>' + '<a id="kaixin" class="share_kaixin" href="http://www.kaixin001.com/repaste/share.php?rurl=' + url_val + '&amp;rcontent=' + title_val + '" target="_blank">开心网</a>').appendTo(d);
		    }
		    ;
		    var s = d.outerWidth(), w = jQuery(window).width(), o = t.offset();
		    d.css({display: 'block',top: o.top + t.height() + 2,left: o.left + s < w ? o.left : w - s});
		}
		var isloadindex = false;
		function dynamic_index() {
		    var $ = jQuery;
		    $(window).scroll(function() {
		        var scrollTop = jQuery(this).scrollTop();
		        var scrollHeight = $(document).height();
		        var windowHeight = $(this).height();
		        if (scrollTop + windowHeight == scrollHeight) {
		            var page = parseInt($("#curpage").val()) + 1;
		            var totalpage = parseInt($("#totalpage").val());
		            if (page <= totalpage && page <= 10) {
		                if (!isloadindex) {
		                    isloadindex = true;
		                    $.ajax({url: '/ajax.php?mod=indexlist&inajax=1&page=' + page,success: function(data) {
		                            $("#pagehtml_container").remove();
		                            $("#thread_listbox").append(data);
		                            isloadindex = false;
		                        }});
		                }
		            }
		        }
		    });
		}
		jQuery(document).ready(function() {
		    var $ = jQuery;
		    $(".jdropdown").hover(function() {
		        $(this).addClass("on");
		    }, function() {
		        $(this).removeClass("on");
		    });
		});

	</script>
	<script>
		function saveData(ignoreempty) {
    var ignoreempty = isUndefined(ignoreempty) ? 0 : ignoreempty;
    var obj = $('postform') && (($('fwin_newthread') && $('fwin_newthread').style.display == '') || ($('fwin_reply') && $('fwin_reply').style.display == '')) ? $('postform') : ($('fastpostform') ? $('fastpostform') : $('postform'));
    if (!obj)
        return;
    if (typeof isfirstpost != 'undefined') {
        if (typeof wysiwyg != 'undefined' && wysiwyg == 1) {
            var messageisnull = trim(html2bbcode(editdoc.body.innerHTML)) === '';
        } else {
            var messageisnull = $('postform').message.value === '';
        }
        if (isfirstpost && (messageisnull && $('postform').subject.value === '')) {
            return;
        }
        if (!isfirstpost && messageisnull) {
            return;
        }
    }
    var data = subject = message = '';
    for (var i = 0; i < obj.elements.length; i++) {
        var el = obj.elements[i];
        if (el.name != '' && (el.tagName == 'SELECT' || el.tagName == 'TEXTAREA' || el.tagName == 'INPUT' && (el.type == 'text' || el.type == 'checkbox' || el.type == 'radio' || el.type == 'hidden' || el.type == 'select')) && el.name.substr(0, 6) != 'attach') {
            var elvalue = el.value;
            if (el.name == 'subject') {
                subject = trim(elvalue);
            } else if (el.name == 'message') {
                if (typeof wysiwyg != 'undefined' && wysiwyg == 1) {
                    elvalue = html2bbcode(editdoc.body.innerHTML);
                }
                message = trim(elvalue);
            }
            if ((el.type == 'checkbox' || el.type == 'radio') && !el.checked) {
                continue;
            } else if (el.tagName == 'SELECT') {
                elvalue = el.value;
            } else if (el.type == 'hidden') {
                if (el.id) {
                    eval('var check = typeof ' + el.id + '_upload == \'function\'');
                    if (check) {
                        elvalue = elvalue;
                        if ($(el.id + '_url')) {
                            elvalue += String.fromCharCode(1) + $(el.id + '_url').value;
                        }
                    } else {
                        continue;
                    }
                } else {
                    continue;
                }
            }
            if (trim(elvalue)) {
                data += el.name + String.fromCharCode(9) + el.tagName + String.fromCharCode(9) + el.type + String.fromCharCode(9) + elvalue + String.fromCharCode(9, 9);
            }
        }
    }
    if (!subject && !message && !ignoreempty) {
        return;
    }
    saveUserdata('forum_' + discuz_uid, data);
}
function fastUload() {
    appendscript(JSPATH + 'forum_post.js?' + VERHASH);
    safescript('forum_post_js', function() {
        uploadWindow(function(aid, url) {
            updatefastpostattach(aid, url)
        }, 'file')
    }, 100, 50);
}
function switchAdvanceMode(url) {
    var obj = $('postform') && (($('fwin_newthread') && $('fwin_newthread').style.display == '') || ($('fwin_reply') && $('fwin_reply').style.display == '')) ? $('postform') : $('fastpostform');
    if (obj && obj.message.value != '') {
        saveData();
        url += (url.indexOf('?') != -1 ? '&' : '?') + 'cedit=yes';
    }
    location.href = url;
    return false;
}
function sidebar_collapse(lang) {
    if (lang[0]) {
        toggle_collapse('sidebar', null, null, lang);
        $('wrap').className = $('wrap').className == 'wrap with_side s_clear' ? 'wrap s_clear' : 'wrap with_side s_clear';
    } else {
        var collapsed = getcookie('collapse');
        collapsed = updatestring(collapsed, 'sidebar', 1);
        setcookie('collapse', collapsed, (collapsed ? 2592000 : -2592000));
        location.reload();
    }
}
function keyPageScroll(e, prev, next, url, page) {
    if (loadUserdata('is_blindman')) {
        return true;
    }
    e = e ? e : window.event;
    var tagname = BROWSER.ie ? e.srcElement.tagName : e.target.tagName;
    if (tagname == 'INPUT' || tagname == 'TEXTAREA')
        return;
    actualCode = e.keyCode ? e.keyCode : e.charCode;
    if (next && actualCode == 39) {
        window.location = url + '&page=' + (page + 1);
    }
    if (prev && actualCode == 37) {
        window.location = url + '&page=' + (page - 1);
    }
}
function announcement(options) {
    var ann = new Object();
    var oAnc = $('anc');
    if (!oAnc)
        return;
    options = options || {};
    var box_id = oAnc.getAttribute('data-target'), box;
    box_id && (box = $(box_id));
    if (box) {
        var pos = fetchOffset(oAnc), sz = element_size(oAnc), width = parseInt(getCurrentStyle(box, 'width'));
        width = isNaN(width) ? 0 : width;
        box.style.left = (pos.left + sz.width - width) + 'px';
        box.style.top = (pos.top + sz.height) + 'px';
    }
    ;
    ann.data = {}, ann.anndelay = 3000;
    ann.annst = 0;
    ann.annstop = 0;
    ann.annrowcount = 0;
    ann.anncount = 0;
    ann.annlis = $('anc').getElementsByTagName("li");
    ann.annrows = new Array();
    ann.show_shared_box = function() {
        if (!box)
            return;
        show_pop_menu(oAnc, {offset_x: options.offset_x});
        options.set_shared_title && options.set_shared_title(ann.data.title, ann.data.url);
    };
    ann.get_linkinfo = function(index) {
        if (index >= ann.annlis.length)
            return;
        var li = ann.annlis[index];
        var a = li.getElementsByTagName('a');
        a = a.length ? a[0] : null;
        a && (ann.data.title = a.innerHTML, ann.data.url = a.href);
    };
    ann.announcementScroll = function() {
        if (this.annstop) {
            this.annst = setTimeout(function() {
                ann.announcementScroll();
            }, this.anndelay);
            return;
        }
        if (!this.annst) {
            var lasttop = -1;
            for (i = 0; i < this.annlis.length; i++) {
                if (lasttop != this.annlis[i].offsetTop) {
                    if (lasttop == -1)
                        lasttop = 0;
                    this.annrows[this.annrowcount] = this.annlis[i].offsetTop - lasttop;
                    this.annrowcount++;
                }
                lasttop = this.annlis[i].offsetTop;
            }
            if (this.annrows.length == 1) {
                ann.get_linkinfo(0);
                $('an').onmouseover = function() {
                    ann.show_shared_box();
                };
                $('an').onmouseout = function() {
                    box && hide_pop_menu(oAnc);
                };
            } else {
                this.annrows[this.annrowcount] = this.annrows[1];
                $('ancl').innerHTML += $('ancl').innerHTML;
                this.annst = setTimeout(function() {
                    ann.announcementScroll();
                }, this.anndelay);
                $('an').onmouseover = function() {
                    ann.show_shared_box();
                    ann.annstop = 1;
                };
                $('an').onmouseout = function() {
                    box && hide_pop_menu(oAnc), ann.annstop = 0;
                };
            }
            this.annrowcount = 1;
            return;
        }
        ann.get_linkinfo(this.annrowcount);
        if (this.annrowcount >= this.annrows.length) {
            $('anc').scrollTop = 0;
            this.annrowcount = 1;
            this.annst = setTimeout(function() {
                ann.announcementScroll();
            }, this.anndelay);
        } else {
            this.anncount = 0;
            this.announcementScrollnext(this.annrows[this.annrowcount]);
        }
    };
    ann.announcementScrollnext = function(time) {
        $('anc').scrollTop++;
        this.anncount++;
        if (this.anncount != time) {
            this.annst = setTimeout(function() {
                ann.announcementScrollnext(time);
            }, 10);
        } else {
            this.annrowcount++;
            this.annst = setTimeout(function() {
                ann.announcementScroll();
            }, this.anndelay);
        }
    };
    ann.announcementScroll();
}
function removeindexheats() {
    return confirm('您确认要把此主题从热点主题中移除么？');
}
function showTypes(id, mod) {
    var o = $(id);
    if (!o)
        return false;
    var s = o.className;
    mod = isUndefined(mod) ? 1 : mod;
    var baseh = o.getElementsByTagName('li')[0].offsetHeight * 2;
    var tmph = o.offsetHeight;
    var lang = ['展开', '收起'];
    var cls = ['unfold', 'fold'];
    if (tmph > baseh) {
        var octrl = document.createElement('li');
        octrl.className = cls[mod];
        octrl.innerHTML = lang[mod];
        o.insertBefore(octrl, o.firstChild);
        o.className = s + ' cttp';
        mod && (o.style.height = 'auto');
        octrl.onclick = function() {
            if (this.className == cls[0]) {
                o.style.height = 'auto';
                this.className = cls[1];
                this.innerHTML = lang[1];
            } else {
                o.style.height = '';
                this.className = cls[0];
                this.innerHTML = lang[0];
            }
        }
    }
}
var postpt = 0;
function fastpostvalidate(theform, noajaxpost) {
    if (postpt) {
        return false;
    }
    postpt = 1;
    setTimeout(function() {
        postpt = 0
    }, 2000);
    noajaxpost = !noajaxpost ? 0 : noajaxpost;
    s = '';
    if (typeof fastpostvalidateextra == 'function') {
        var v = fastpostvalidateextra();
        if (!v) {
            return false;
        }
    }
    if (theform.message.value == '' || theform.subject.value == '') {
        s = '抱歉，您尚未输入标题或内容';
        theform.message.focus();
    } else if (mb_strlen(theform.subject.value) > 80) {
        s = '您的标题超过 80 个字符的限制';
        theform.subject.focus();
    }
    if (!disablepostctrl && ((postminchars != 0 && mb_strlen(theform.message.value) < postminchars) || (postmaxchars != 0 && mb_strlen(theform.message.value) > postmaxchars))) {
        s = '您的帖子长度不符合要求。\n\n当前长度: ' + mb_strlen(theform.message.value) + ' ' + '字节\n系统限制: ' + postminchars + ' 到 ' + postmaxchars + ' 字节';
    }
    if (s) {
        showError(s);
        doane();
        $('fastpostsubmit').disabled = false;
        return false;
    }
    $('fastpostsubmit').disabled = true;
    theform.message.value = theform.message.value.replace(/([^>=\]"'\/]|^)((((https?|ftp):\/\/)|www\.)([\w\-]+\.)*[\w\-\u4e00-\u9fa5]+\.([\.a-zA-Z0-9]+|\u4E2D\u56FD|\u7F51\u7EDC|\u516C\u53F8)((\?|\/|:)+[\w\.\/=\?%\-&~`@':+!]*)+\.(jpg|gif|png|bmp))/ig, '$1[img]$2[/img]');
    theform.message.value = parseurl(theform.message.value);
    if (!noajaxpost) {
        ajaxpost('fastpostform', 'fastpostreturn', 'fastpostreturn', 'onerror', $('fastpostsubmit'));
        return false;
    } else {
        return true;
    }
}
function updatefastpostattach(aid, url) {
    ajaxget('forum.php?mod=ajax&action=attachlist&posttime=' + $('posttime').value + (!fid ? '' : '&fid=' + fid), 'attachlist');
    $('attach_tblheader').style.display = '';
}
function succeedhandle_fastnewpost(locationhref, message, param) {
    location.href = locationhref;
}
function errorhandle_fastnewpost() {
    $('fastpostsubmit').disabled = false;
}
function atarget(obj) {
    obj.target = getcookie('atarget') > 0 ? '_blank' : '';
}
function setatarget(v) {
    $('atarget').className = 'y atarget_' + v;
    $('atarget').onclick = function() {
        setatarget(v == 1 ? -1 : 1);
    };
    setcookie('atarget', v, 2592000);
}
function loadData(quiet, formobj) {
    var evalevent = function(obj) {
        var script = obj.parentNode.innerHTML;
        var re = /onclick="(.+?)["|>]/ig;
        var matches = re.exec(script);
        if (matches != null) {
            matches[1] = matches[1].replace(/this\./ig, 'obj.');
            eval(matches[1]);
        }
    };
    var data = '';
    data = loadUserdata('forum_' + discuz_uid);
    var formobj = !formobj ? $('postform') : formobj;
    if (in_array((data = trim(data)), ['', 'null', 'false', null, false])) {
        if (!quiet) {
            showDialog('没有可以恢复的数据！', 'info');
        }
        return;
    }
    if (!quiet && !confirm('此操作将覆盖当前帖子内容，确定要恢复数据吗？')) {
        return;
    }
    var data = data.split(/\x09\x09/);
    for (var i = 0; i < formobj.elements.length; i++) {
        var el = formobj.elements[i];
        if (el.name != '' && (el.tagName == 'SELECT' || el.tagName == 'TEXTAREA' || el.tagName == 'INPUT' && (el.type == 'text' || el.type == 'checkbox' || el.type == 'radio' || el.type == 'hidden'))) {
            for (var j = 0; j < data.length; j++) {
                var ele = data[j].split(/\x09/);
                if (ele[0] == el.name) {
                    elvalue = !isUndefined(ele[3]) ? ele[3] : '';
                    if (ele[1] == 'INPUT') {
                        if (ele[2] == 'text') {
                            el.value = elvalue;
                        } else if ((ele[2] == 'checkbox' || ele[2] == 'radio') && ele[3] == el.value) {
                            el.checked = true;
                            evalevent(el);
                        } else if (ele[2] == 'hidden') {
                            eval('var check = typeof ' + el.id + '_upload == \'function\'');
                            if (check) {
                                var v = elvalue.split(/\x01/);
                                el.value = v[0];
                                if (el.value) {
                                    if ($(el.id + '_url') && v[1]) {
                                        $(el.id + '_url').value = v[1];
                                    }
                                    eval(el.id + '_upload(\'' + v[0] + '\', \'' + v[1] + '\')');
                                    if ($('unused' + v[0])) {
                                        var attachtype = $('unused' + v[0]).parentNode.parentNode.parentNode.parentNode.id.substr(11);
                                        $('unused' + v[0]).parentNode.parentNode.outerHTML = '';
                                        $('unusednum_' + attachtype).innerHTML = parseInt($('unusednum_' + attachtype).innerHTML) - 1;
                                        if ($('unusednum_' + attachtype).innerHTML == 0 && $('attachnotice_' + attachtype)) {
                                            $('attachnotice_' + attachtype).style.display = 'none';
                                        }
                                    }
                                }
                            }
                        }
                    } else if (ele[1] == 'TEXTAREA') {
                        if (ele[0] == 'message') {
                            if (!wysiwyg) {
                                textobj.value = elvalue;
                            } else {
                                editdoc.body.innerHTML = bbcode2html(elvalue);
                            }
                        } else {
                            el.value = elvalue;
                        }
                    } else if (ele[1] == 'SELECT') {
                        if ($(el.id + '_ctrl_menu')) {
                            var lis = $(el.id + '_ctrl_menu').getElementsByTagName('li');
                            for (var k = 0; k < lis.length; k++) {
                                if (ele[3] == lis[k].k_value) {
                                    lis[k].onclick();
                                    break;
                                }
                            }
                        } else {
                            for (var k = 0; k < el.options.length; k++) {
                                if (ele[3] == el.options[k].value) {
                                    el.options[k].selected = true;
                                    break;
                                }
                            }
                        }
                    }
                    break;
                }
            }
        }
    }
    if ($('rstnotice')) {
        $('rstnotice').style.display = 'none';
    }
    extraCheckall();
}
var checkForumcount = 0, checkForumtimeout = 30000, checkForumnew_handle;
function checkForumnew(fid, lasttime) {
    var timeout = checkForumtimeout;
    var x = new Ajax();
    x.get('forum.php?mod=ajax&action=forumchecknew&fid=' + fid + '&time=' + lasttime + '&inajax=yes', function(s) {
        if (s > 0) {
            var table = $('separatorline').parentNode;
            if (!isUndefined(checkForumnew_handle)) {
                clearTimeout(checkForumnew_handle);
            }
            removetbodyrow(table, 'forumnewshow');
            var colspan = 6;
            var checknew = {'tid': '','thread': {'common': {'className': '','val': '<a href="javascript:void(0);" onclick="ajaxget(\'forum.php?mod=ajax&action=forumchecknew&fid=' + fid + '&time=' + lasttime + '&uncheck=1&inajax=yes\', \'forumnew\');">有新回复的主题，点击查看','colspan': colspan}}};
            addtbodyrow(table, ['tbody'], ['forumnewshow'], 'separatorline', checknew);
        } else {
            if (checkForumcount < 50) {
                if (checkForumcount > 0) {
                    var multiple = Math.ceil(50 / checkForumcount);
                    if (multiple < 5) {
                        timeout = checkForumtimeout * (5 - multiple + 1);
                    }
                }
                checkForumnew_handle = setTimeout(function() {
                    checkForumnew(fid, lasttime);
                }, timeout);
            }
        }
        checkForumcount++;
    });
}
function checkForumnew_btn(fid) {
    if (isUndefined(fid))
        return;
    ajaxget('forum.php?mod=ajax&action=forumchecknew&fid=' + fid + '&time=' + lasttime + '&uncheck=2&inajax=yes', 'forumnew', 'ajaxwaitid');
    lasttime = parseInt(Date.parse(new Date()) / 1000);
}
function addtbodyrow(table, insertID, changename, separatorid, jsonval) {
    if (isUndefined(table) || isUndefined(insertID[0])) {
        return;
    }
    var insertobj = document.createElement(insertID[0]);
    var thread = jsonval.thread;
    var tid = !isUndefined(jsonval.tid) ? jsonval.tid : '';
    if (!isUndefined(changename[1])) {
        removetbodyrow(table, changename[1] + tid);
    }
    insertobj.id = changename[0] + tid;
    if (!isUndefined(insertID[1])) {
        insertobj.className = insertID[1];
    }
    if ($(separatorid)) {
        table.insertBefore(insertobj, $(separatorid).nextSibling);
    } else {
        table.insertBefore(insertobj, table.firstChild);
    }
    var newTH = insertobj.insertRow(-1);
    for (var value in thread) {
        if (value != 0) {
            var cell = newTH.insertCell(-1);
            if (isUndefined(thread[value]['val'])) {
                cell.innerHTML = thread[value];
            } else {
                cell.innerHTML = thread[value]['val'];
            }
            if (!isUndefined(thread[value]['className'])) {
                cell.className = thread[value]['className'];
            }
            if (!isUndefined(thread[value]['colspan'])) {
                cell.colSpan = thread[value]['colspan'];
            }
        }
    }
    if (!isUndefined(insertID[2])) {
        _attachEvent(insertobj, insertID[2], function() {
            insertobj.className = '';
        });
    }
}
function removetbodyrow(from, objid) {
    if (!isUndefined(from) && $(objid)) {
        from.removeChild($(objid));
    }
}
function leftside(id) {
    $(id).className = $(id).className == 'a' ? '' : 'a';
    if (id == 'lf_fav') {
        setcookie('leftsidefav', $(id).className == 'a' ? 0 : 1, 2592000);
    }
}
var DTimers = new Array();
var DItemIDs = new Array();
var DTimers_exists = false;
function settimer(timer, itemid) {
    if (timer && itemid) {
        DTimers.push(timer);
        DItemIDs.push(itemid);
    }
    if (!DTimers_exists) {
        setTimeout("showtime()", 1000);
        DTimers_exists = true;
    }
}
function showtime() {
    for (i = 0; i <= DTimers.length; i++) {
        if (DItemIDs[i]) {
            if (DTimers[i] == 0) {
                $(DItemIDs[i]).innerHTML = '已结束';
                DItemIDs[i] = '';
                continue;
            }
            var timestr = '';
            var timer_day = Math.floor(DTimers[i] / 86400);
            var timer_hour = Math.floor((DTimers[i] % 86400) / 3600);
            var timer_minute = Math.floor(((DTimers[i] % 86400) % 3600) / 60);
            var timer_second = (((DTimers[i] % 86400) % 3600) % 60);
            if (timer_day > 0) {
                timestr += timer_day + '天';
            }
            if (timer_hour > 0) {
                timestr += timer_hour + '小时'
            }
            if (timer_minute > 0) {
                timestr += timer_minute + '分'
            }
            if (timer_second > 0) {
                timestr += timer_second + '秒'
            }
            DTimers[i] = DTimers[i] - 1;
            $(DItemIDs[i]).innerHTML = timestr;
        }
    }
    setTimeout("showtime()", 1000);
}
function fixed_top_nv(eleid, disbind) {
    this.nv = eleid && $(eleid) || $('nv');
    this.openflag = this.nv && BROWSER.ie != 6;
    this.nvdata = {};
    this.init = function(disattachevent) {
        if (this.openflag) {
            if (!disattachevent) {
                var obj = this;
                _attachEvent(window, 'resize', function() {
                    obj.reset();
                    obj.init(1);
                    obj.run();
                });
                var switchwidth = $('switchwidth');
                if (switchwidth) {
                    _attachEvent(switchwidth, 'click', function() {
                        obj.reset();
                        obj.openflag = false;
                    });
                }
            }
            var next = this.nv;
            try {
                while ((next = next.nextSibling).nodeType != 1 || next.style.display === 'none') {
                }
                this.nvdata.next = next;
                this.nvdata.height = parseInt(this.nv.offsetHeight, 10);
                this.nvdata.width = parseInt(this.nv.offsetWidth, 10);
                this.nvdata.left = this.nv.getBoundingClientRect().left - document.documentElement.clientLeft;
                this.nvdata.position = this.nv.style.position;
                this.nvdata.opacity = this.nv.style.opacity;
            } catch (e) {
                this.nvdata.next = null;
            }
        }
    };
    this.run = function() {
        var fixedheight = 0;
        if (this.openflag && this.nvdata.next) {
            var nvnexttop = document.body.scrollTop || document.documentElement.scrollTop;
            var dofixed = nvnexttop !== 0 && document.documentElement.clientHeight >= 15 && this.nvdata.next.getBoundingClientRect().top - this.nvdata.height < 0;
            if (dofixed) {
                if (this.nv.style.position != 'fixed') {
                    this.nv.style.borderLeftWidth = '0';
                    this.nv.style.borderRightWidth = '0';
                    this.nv.style.height = this.nvdata.height + 'px';
                    this.nv.style.width = this.nvdata.width + 'px';
                    this.nv.style.top = '0';
                    this.nv.style.left = this.nvdata.left + 'px';
                    this.nv.style.position = 'fixed';
                    this.nv.style.zIndex = '199';
                    this.nv.style.opacity = 0.85;
                }
            } else {
                if (this.nv.style.position != this.nvdata.position) {
                    this.reset();
                }
            }
            if (this.nv.style.position == 'fixed') {
                fixedheight = this.nvdata.height;
            }
        }
        return fixedheight;
    };
    this.reset = function() {
        if (this.nv && this.nvdata.position) {
            this.nv.style.position = this.nvdata.position;
            this.nv.style.borderLeftWidth = '';
            this.nv.style.borderRightWidth = '';
            this.nv.style.height = '';
            this.nv.style.width = '';
            this.nv.style.opacity = this.nvdata.opacity;
        }
    };
    if (!disbind && this.openflag) {
        this.init();
        _attachEvent(window, 'scroll', this.run);
    }
}
var previewTbody = null, previewTid = null, previewDiv = null;
function previewThread(tid, tbody) {
    if (!$('threadPreviewTR_' + tid)) {
        appendscript(JSPATH + 'forum_viewthread.js?' + VERHASH);
        newTr = document.createElement('tr');
        newTr.id = 'threadPreviewTR_' + tid;
        newTr.className = 'threadpre';
        $(tbody).appendChild(newTr);
        newTd = document.createElement('td');
        newTd.colSpan = listcolspan;
        newTd.className = 'threadpretd';
        newTr.appendChild(newTd);
        newTr.style.display = 'none';
        previewTbody = tbody;
        previewTid = tid;
        if (BROWSER.ie) {
            previewDiv = document.createElement('div');
            previewDiv.id = 'threadPreview_' + tid;
            previewDiv.style.id = 'none';
            var x = Ajax();
            x.get('forum.php?mod=viewthread&tid=' + tid + '&inajax=1&from=preview', function(ret) {
                var evaled = false;
                if (ret.indexOf('ajaxerror') != -1) {
                    evalscript(ret);
                    evaled = true;
                }
                var cell = $(tbody).getElementsByTagName('th')[0];
                cell.style.border = 'none';
                newTd.style.borderBottom = '1px dotted #8E8E8E';
                previewDiv.innerHTML = ret;
                newTd.appendChild(previewDiv);
                if (!evaled)
                    evalscript(ret);
                newTr.style.display = '';
            });
        } else {
            newTd.innerHTML += '<div id="threadPreview_' + tid + '"></div>';
            ajaxget('forum.php?mod=viewthread&tid=' + tid + '&from=preview', 'threadPreview_' + tid, null, null, null, function() {
                newTr.style.display = '';
                var cell = $(tbody).getElementsByTagName('th')[0];
                cell.style.border = 'none';
                newTd.style.borderBottom = '1px dotted #8E8E8E';
            });
        }
    } else {
        var cell = $(tbody).getElementsByTagName('th')[0];
        cell.style.borderBottom = '1px dotted #8E8E8E';
        $(tbody).removeChild($('threadPreviewTR_' + tid));
        previewTbody = previewTid = null;
    }
}
function hideStickThread(tid, pre) {
    var pre = pre || 'stickthread_';
    var tids = (new Function("return (" + (loadUserdata('sticktids') || '[]') + ")"))();
    var format = function(data) {
        var str = '{';
        for (var i in data) {
            if (data[i] instanceof Array) {
                str += i + ':' + '[';
                for (var j = data[i].length - 1; j >= 0; j--) {
                    str += data[i][j] + ',';
                }
                ;
                str = str.substr(0, str.length - 1);
                str += '],';
            }
        }
        str = str.substr(0, str.length - 1);
        str += '}';
        return str;
    };
    if (!tid) {
        if (tids.length > 0) {
            for (var i = tids.length - 1; i >= 0; i--) {
                var ele = $(pre + tids[i]);
                if (ele) {
                    ele.parentNode.removeChild(ele);
                }
            }
            ;
        }
    } else {
        var eletbody = $(pre + tid);
        if (eletbody) {
            eletbody.parentNode.removeChild(eletbody);
            tids.push(tid);
            saveUserdata('sticktids', '[' + tids.join(',') + ']');
        }
    }
    var clearstickthread = $('clearstickthread');
    if (clearstickthread) {
        if (tids.length > 0) {
            $('clearstickthread').style.display = '';
        } else {
            $('clearstickthread').style.display = 'none';
        }
    }
    var separatorline = $('separatorline');
    if (separatorline) {
        try {
            if (typeof separatorline.previousElementSibling === 'undefined') {
                var findele = separatorline.previousSibling;
                while (findele && findele.nodeType != 1) {
                    findele = findele.previousSibling;
                }
                if (findele === null) {
                    separatorline.parentNode.removeChild(separatorline);
                }
            } else {
                if (separatorline.previousElementSibling === null) {
                    separatorline.parentNode.removeChild(separatorline);
                }
            }
        } catch (e) {
        }
    }
}
function viewhot() {
    var obj = $('hottime');
    window.location.href = "forum.php?mod=forumdisplay&filter=hot&fid=" + obj.getAttribute('fid') + "&time=" + obj.value;
}
function clearStickThread() {
    saveUserdata('sticktids', '[]');
    location.reload();
}
function ctltab(show, hide, shownav, hidenav) {
    var hidectl = hide.split(',');
    var showctl = show.split(',');
    var hidenav = hidenav.split(',');
    var shownav = shownav.split(',');
    for (var i = 0; i < hidectl.length; i++) {
        jQuery(hidectl[i]).hide();
    }
    for (var i = 0; i < showctl.length; i++) {
        jQuery(showctl[i]).show();
    }
    for (var i = 0; i < hidenav.length; i++) {
        jQuery(hidenav[i]).removeClass("cur");
    }
    for (var i = 0; i < shownav.length; i++) {
        jQuery(shownav[i]).addClass("cur");
    }
}

	</script>
	<script>
		function _relatedlinks(rlinkmsgid) {
    if (!$(rlinkmsgid) || $(rlinkmsgid).innerHTML.match(/<script[^\>]*?>/i)) {
        return;
    }
    var alink = new Array(), ignore = new Array();
    var i = 0;
    var msg = $(rlinkmsgid).innerHTML;
    msg = msg.replace(/(<ignore_js_op\>[\s|\S]*?<\/ignore_js_op\>)/ig, function($1) {
        ignore[i] = $1;
        i++;
        return '#ignore_js_op ' + (i - 1) + '#';
    });
    var alink_i = 0;
    msg = msg.replace(/(<a.*?<\/a\>)/ig, function($1) {
        alink[alink_i] = $1;
        alink_i++;
        return '#alink ' + (alink_i - 1) + '#';
    });
    var relatedid = new Array();
    msg = msg.replace(/(^|>)([^<]+)(?=<|$)/ig, function($1, $2, $3) {
        for (var j = 0; j < relatedlink.length; j++) {
            if (relatedlink[j] && !relatedid[j]) {
                if (relatedlink[j]['surl'] != '') {
                    var ra = '<a href="' + relatedlink[j]['surl'] + '" target="_blank" class="relatedlink">' + relatedlink[j]['sname'] + '</a>';
                    alink[alink_i] = ra;
                    ra = '#alink ' + alink_i + '#';
                    alink_i++;
                } else {
                    var ra = '<strong><font color="#FF0000">' + relatedlink[j]['sname'] + '</font></strong>';
                }
                var $rtmp = $3;
                $3 = $3.replace(relatedlink[j]['sname'], ra);
                if ($3 != $rtmp) {
                    relatedid[j] = 1;
                }
            }
        }
        return $2 + $3;
    });
    for (var k in alink) {
        msg = msg.replace('#alink ' + k + '#', alink[k]);
    }
    for (var l in ignore) {
        msg = msg.replace('#ignore_js_op ' + l + '#', ignore[l]);
    }
    $(rlinkmsgid).innerHTML = msg;
}
function _updatesecqaa(idhash) {
    if ($('secqaa_' + idhash)) {
        $('secqaaverify_' + idhash).value = '';
        if (secST['qaa_' + idhash]) {
            clearTimeout(secST['qaa_' + idhash]);
        }
        $('checksecqaaverify_' + idhash).innerHTML = '<img src="' + IMGDIR + '/none.gif" width="16" height="16" class="vm" />';
        ajaxget('misc.php?mod=secqaa&action=update&idhash=' + idhash, 'secqaa_' + idhash, null, '', '', function() {
            secST['qaa_' + idhash] = setTimeout(function() {
                $('secqaa_' + idhash).innerHTML = '<span class="xi2 cur1" onclick="updatesecqaa(\'' + idhash + '\')">刷新验证问答</span>';
            }, 180000);
        });
    }
}
function _updateseccode(idhash, play) {
    if (isUndefined(play)) {
        if ($('seccode_' + idhash)) {
            $('seccodeverify_' + idhash).value = '';
            if (secST['code_' + idhash]) {
                clearTimeout(secST['code_' + idhash]);
            }
            $('checkseccodeverify_' + idhash).innerHTML = '<img src="' + IMGDIR + '/none.gif" width="16" height="16" class="vm" />';
            ajaxget('misc.php?mod=seccode&action=update&idhash=' + idhash, 'seccode_' + idhash, null, '', '', function() {
                secST['code_' + idhash] = setTimeout(function() {
                    $('seccode_' + idhash).innerHTML = '<span class="xi2 cur1" onclick="updateseccode(\'' + idhash + '\')">刷新验证码</span>';
                }, 180000);
            });
        }
    } else {
        eval('window.document.seccodeplayer_' + idhash + '.SetVariable("isPlay", "1")');
    }
}
function _checksec(type, idhash, showmsg, recall) {
    var showmsg = !showmsg ? 0 : showmsg;
    var secverify = $('sec' + type + 'verify_' + idhash).value;
    if (!secverify) {
        return;
    }
    var x = new Ajax('XML', 'checksec' + type + 'verify_' + idhash);
    x.loading = '';
    $('checksec' + type + 'verify_' + idhash).innerHTML = '<img src="' + IMGDIR + '/loading.gif" width="16" height="16" class="vm" />';
    x.get('misc.php?mod=sec' + type + '&action=check&inajax=1&&idhash=' + idhash + '&secverify=' + (BROWSER.ie && document.charset == 'utf-8' ? encodeURIComponent(secverify) : secverify), function(s) {
        var obj = $('checksec' + type + 'verify_' + idhash);
        obj.style.display = '';
        if (s.substr(0, 7) == 'succeed') {
            obj.innerHTML = '<img src="' + IMGDIR + '/check_right.gif" width="16" height="16" class="vm" />';
            if (showmsg) {
                recall(1);
            }
        } else {
            obj.innerHTML = '<img src="' + IMGDIR + '/check_error.gif" width="16" height="16" class="vm" />';
            if (showmsg) {
                if (type == 'code') {
                    showError('验证码错误，请重新填写');
                } else if (type == 'qaa') {
                    showError('验证问答错误，请重新填写');
                }
                recall(0);
            }
        }
    });
}
function _setDoodle(fid, oid, url, tid, from) {
    if (tid == null) {
        hideWindow(fid);
    } else {
        $(tid).style.display = '';
        $(fid).style.display = 'none';
    }
    var doodleText = '[img]' + url + '[/img]';
    if ($(oid) != null) {
        if (from == "editor") {
            insertImage(url);
        } else if (from == "fastpost") {
            seditor_insertunit('fastpost', doodleText);
        } else if (from == "forumeditor") {
            if (wysiwyg) {
                insertText('<img src="' + url + '" border="0" alt="" />', false);
            } else {
                insertText(doodleText, strlen(doodleText), 0);
            }
        } else {
            insertContent(oid, doodleText);
        }
    }
}
function _showdistrict(container, elems, totallevel, changelevel, containertype) {
    var getdid = function(elem) {
        var op = elem.options[elem.selectedIndex];
        return op['did'] || op.getAttribute('did') || '0';
    };
    var pid = changelevel >= 1 && elems[0] && $(elems[0]) ? getdid($(elems[0])) : 0;
    var cid = changelevel >= 2 && elems[1] && $(elems[1]) ? getdid($(elems[1])) : 0;
    var did = changelevel >= 3 && elems[2] && $(elems[2]) ? getdid($(elems[2])) : 0;
    var coid = changelevel >= 4 && elems[3] && $(elems[3]) ? getdid($(elems[3])) : 0;
    var url = "home.php?mod=misc&ac=ajax&op=district&container=" + container + "&containertype=" + containertype + "&province=" + elems[0] + "&city=" + elems[1] + "&district=" + elems[2] + "&community=" + elems[3] + "&pid=" + pid + "&cid=" + cid + "&did=" + did + "&coid=" + coid + '&level=' + totallevel + '&handlekey=' + container + '&inajax=1' + (!changelevel ? '&showdefault=1' : '');
    ajaxget(url, container, '');
}
function _copycode(obj) {
    if (!obj)
        return false;
    if (window.getSelection) {
        var sel = window.getSelection();
        if (sel.setBaseAndExtent) {
            sel.setBaseAndExtent(obj, 0, obj, 1);
        } else {
            var rng = document.createRange();
            rng.selectNodeContents(obj);
            sel.addRange(rng);
        }
    } else {
        var rng = document.body.createTextRange();
        rng.moveToElementText(obj);
        rng.select();
    }
    setCopy(BROWSER.ie ? obj.innerText.replace(/\r\n\r\n/g, '\r\n') : obj.textContent, '代码已复制到剪贴板');
}
function _setCopy(text, msg) {
    if (BROWSER.ie) {
        var r = clipboardData.setData('Text', text);
        if (r) {
            if (msg) {
                showPrompt(null, null, '<span>' + msg + '</span>', 1500);
            }
        } else {
            showDialog('<div class="c"><div style="width: 200px; text-align: center;">复制失败，请选择“允许访问”</div></div>', 'alert');
        }
    } else {
        var msg = '<div class="c"><div style="width: 200px; text-align: center; text-decoration:underline;">点此复制到剪贴板</div>' + AC_FL_RunContent('id', 'clipboardswf', 'name', 'clipboardswf', 'devicefont', 'false', 'width', '200', 'height', '40', 'src', STATICURL + 'image/common/clipboard.swf', 'menu', 'false', 'allowScriptAccess', 'sameDomain', 'swLiveConnect', 'true', 'wmode', 'transparent', 'style', 'margin-top:-20px') + '</div>';
        showDialog(msg, 'info');
        text = text.replace(/[\xA0]/g, ' ');
        CLIPBOARDSWFDATA = text;
    }
}
function _showselect(obj, inpid, t, rettype) {
    var showselect_row = function(inpid, s, v, notime, rettype) {
        if (v >= 0) {
            if (!rettype) {
                var notime = !notime ? 0 : 1;
                var t = today.getTime();
                t += 86400000 * v;
                var d = new Date();
                d.setTime(t);
                var month = d.getMonth() + 1;
                month = month < 10 ? '0' + month : month;
                var day = d.getDate();
                day = day < 10 ? '0' + day : day;
                var hour = d.getHours();
                hour = hour < 10 ? '0' + hour : hour;
                var minute = d.getMinutes();
                minute = minute < 10 ? '0' + minute : minute;
                return '<a href="javascript:;" onclick="$(\'' + inpid + '\').value = \'' + d.getFullYear() + '-' + month + '-' + day + (!notime ? ' ' + hour + ':' + minute : '') + '\'">' + s + '</a>';
            } else {
                return '<a href="javascript:;" onclick="$(\'' + inpid + '\').value = \'' + v + '\'">' + s + '</a>';
            }
        } else if (v == -1) {
            return '<a href="javascript:;" onclick="$(\'' + inpid + '\').focus()">' + s + '</a>';
        } else if (v == -2) {
            return '<a href="javascript:;" onclick="$(\'' + inpid + '\').onclick()">' + s + '</a>';
        }
    };
    if (!obj.id) {
        var t = !t ? 0 : t;
        var rettype = !rettype ? 0 : rettype;
        obj.id = 'calendarexp_' + Math.random();
        div = document.createElement('div');
        div.id = obj.id + '_menu';
        div.style.display = 'none';
        div.className = 'p_pop';
        $('append_parent').appendChild(div);
        s = '';
        if (!t) {
            s += showselect_row(inpid, '一天', 1, 0, rettype);
            s += showselect_row(inpid, '一周', 7, 0, rettype);
            s += showselect_row(inpid, '一个月', 30, 0, rettype);
            s += showselect_row(inpid, '三个月', 90, 0, rettype);
            s += showselect_row(inpid, '自定义', -2);
        } else {
            if ($(t)) {
                var lis = $(t).getElementsByTagName('LI');
                for (i = 0; i < lis.length; i++) {
                    s += '<a href="javascript:;" onclick="$(\'' + inpid + '\').value = this.innerHTML;$(\'' + obj.id + '_menu\').style.display=\'none\'">' + lis[i].innerHTML + '</a>';
                }
                s += showselect_row(inpid, '自定义', -1);
            } else {
                s += '<a href="javascript:;" onclick="$(\'' + inpid + '\').value = \'0\'">永久</a>';
                s += showselect_row(inpid, '7 天', 7, 1, rettype);
                s += showselect_row(inpid, '14 天', 14, 1, rettype);
                s += showselect_row(inpid, '一个月', 30, 1, rettype);
                s += showselect_row(inpid, '三个月', 90, 1, rettype);
                s += showselect_row(inpid, '半年', 182, 1, rettype);
                s += showselect_row(inpid, '一年', 365, 1, rettype);
                s += showselect_row(inpid, '自定义', -1);
            }
        }
        $(div.id).innerHTML = s;
    }
    showMenu({'ctrlid': obj.id,'evt': 'click'});
    if (BROWSER.ie && BROWSER.ie < 7) {
        doane(event);
    }
}
function _zoom(obj, zimg, nocover, pn, showexif) {
    zimg = !zimg ? obj.src : zimg;
    showexif = !parseInt(showexif) ? 0 : showexif;
    if (!zoomstatus) {
        window.open(zimg, '', '');
        return;
    }
    if (!obj.id)
        obj.id = 'img_' + Math.random();
    var faid = !obj.getAttribute('aid') ? 0 : obj.getAttribute('aid');
    var menuid = 'imgzoom';
    var menu = $(menuid);
    var zoomid = menuid + '_zoom';
    var imgtitle = !nocover && obj.title ? '<div class="imgzoom_title">' + htmlspecialchars(obj.title) + '</div>' + (showexif ? '<div id="' + zoomid + '_exif" class="imgzoom_exif" onmouseover="this.className=\'imgzoom_exif imgzoom_exif_hover\'" onmouseout="this.className=\'imgzoom_exif\'"></div>' : '') : '';
    var cover = !nocover ? 1 : 0;
    var pn = !pn ? 0 : 1;
    var maxh = (document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight) - 70;
    var loadCheck = function(obj) {
        if (obj.complete) {
            var imgw = loading.width;
            var imgh = loading.height;
            var r = imgw / imgh;
            var w = document.body.clientWidth * 0.95;
            w = imgw > w ? w : imgw;
            var h = w / r;
            if (w < 100 & h < 100) {
                $(menuid + '_waiting').style.display = 'none';
                hideMenu();
                return;
            }
            if (h > maxh) {
                h = maxh;
                w = h * r;
            }
            if ($(menuid)) {
                $(menuid).removeAttribute('top_');
                $(menuid).removeAttribute('left_');
                clearTimeout($(menuid).getAttribute('timer'));
            }
            showimage(zimg, w, h, imgw, imgh);
            if (showexif && faid) {
                var x = new Ajax();
                x.get('forum.php?mod=ajax&action=exif&aid=' + faid + '&inajax=1', function(s, x) {
                    if (s) {
                        $(zoomid + '_exif').style.display = '';
                        $(zoomid + '_exif').innerHTML = s;
                    } else {
                        $(zoomid + '_exif').style.display = 'none';
                    }
                });
            }
        } else {
            setTimeout(function() {
                loadCheck(loading);
            }, 100);
        }
    };
    var showloading = function(zimg, pn) {
        if (!pn) {
            if (!$(menuid + '_waiting')) {
                waiting = document.createElement('img');
                waiting.id = menuid + '_waiting';
                waiting.src = IMGDIR + '/imageloading.gif';
                waiting.style.opacity = '0.8';
                waiting.style.filter = 'alpha(opacity=80)';
                waiting.style.position = 'absolute';
                waiting.style.zIndex = '100000';
                $('append_parent').appendChild(waiting);
            }
        }
        $(menuid + '_waiting').style.display = '';
        $(menuid + '_waiting').style.left = (document.body.clientWidth - 42) / 2 + 'px';
        $(menuid + '_waiting').style.top = ((document.documentElement.clientHeight - 42) / 2 + Math.max(document.documentElement.scrollTop, document.body.scrollTop)) + 'px';
        loading = new Image();
        setTimeout(function() {
            loadCheck(loading);
        }, 100);
        if (!pn) {
            $(menuid + '_zoomlayer').style.display = 'none';
        }
        loading.src = zimg;
    };
    var adjustpn = function(h) {
        h = h < 90 ? 90 : h;
        if ($('zimg_prev')) {
            $('zimg_prev').style.height = parseInt(h) + 'px';
        }
        if ($('zimg_next')) {
            $('zimg_next').style.height = parseInt(h) + 'px';
        }
    };
    var showimage = function(zimg, w, h, imgw, imgh) {
        $(menuid + '_waiting').style.display = 'none';
        $(menuid + '_zoomlayer').style.display = '';
        $(menuid + '_img').style.width = 'auto';
        $(menuid + '_img').style.height = 'auto';
        $(menuid).style.width = (w < 300 ? 320 : w + 20) + 'px';
        mheight = h + 63;
        menu.style.height = mheight + 'px';
        $(menuid + '_zoomlayer').style.height = (mheight < 120 ? 120 : mheight) + 'px';
        $(menuid + '_img').innerHTML = '<img id="' + zoomid + '" src="' + zimg + '" width="' + w + '" height="' + h + '" w="' + imgw + '" h="' + imgh + '" />' + imgtitle;
        if ($(menuid + '_imglink')) {
            $(menuid + '_imglink').href = zimg;
        }
        setMenuPosition('', menuid, '00');
        adjustpn(h);
    };
    var adjustTimer = 0;
    var adjustTimerCount = 0;
    var wheelDelta = 0;
    var clientX = 0;
    var clientY = 0;
    var adjust = function(e, a) {
        if (BROWSER.ie && BROWSER.ie < 7) {
        } else {
            if (adjustTimerCount) {
                adjustTimer = (function() {
                    return setTimeout(function() {
                        adjustTimerCount++;
                        adjust(e);
                    }, 20);
                })();
                $(menuid).setAttribute('timer', adjustTimer);
                if (adjustTimerCount > 17) {
                    clearTimeout(adjustTimer);
                    adjustTimerCount = 0;
                    doane();
                }
            } else if (!a) {
                adjustTimerCount = 1;
                if (adjustTimer) {
                    clearTimeout(adjustTimer);
                    adjust(e, a);
                } else {
                    adjust(e, a);
                }
                doane();
            }
        }
        var ele = $(zoomid);
        if (!ele) {
            return;
        }
        var imgw = ele.getAttribute('w');
        var imgh = ele.getAttribute('h');
        if (!a) {
            e = e || window.event;
            try {
                if (e.altKey || e.shiftKey || e.ctrlKey)
                    return;
            } catch (e) {
                e = {'wheelDelta': wheelDelta,'clientX': clientX,'clientY': clientY};
            }
            var step = 0;
            if (e.wheelDelta <= 0 || e.detail > 0) {
                if (ele.width - 1 <= 200 || ele.height - 1 <= 200) {
                    clearTimeout(adjustTimer);
                    adjustTimerCount = 0;
                    doane(e);
                    return;
                }
                step = parseInt(imgw / ele.width) - 4;
            } else {
                if (ele.width + 1 >= imgw * 40) {
                    clearTimeout(adjustTimer);
                    adjustTimerCount = 0;
                    doane(e);
                    return;
                }
                step = 4 - parseInt(imgw / ele.width) || 2;
            }
            if (BROWSER.ie && BROWSER.ie < 7) {
                step *= 5;
            }
            wheelDelta = e.wheelDelta;
            clientX = e.clientX;
            clientY = e.clientY;
            var ratio = 0;
            if (imgw > imgh) {
                ratio = step / ele.height;
                ele.height += step;
                ele.width = imgw * (ele.height / imgh);
            } else if (imgw < imgh) {
                ratio = step / ele.width;
                ele.width += step;
                ele.height = imgh * (ele.width / imgw);
            }
            if (BROWSER.ie && BROWSER.ie < 7) {
                setMenuPosition('', menuid, '00');
            } else {
                var menutop = parseFloat(menu.getAttribute('top_') || menu.style.top);
                var menuleft = parseFloat(menu.getAttribute('left_') || menu.style.left);
                var imgY = clientY - menutop - 39;
                var imgX = clientX - menuleft - 10;
                var newTop = (menutop - imgY * ratio) + 'px';
                var newLeft = (menuleft - imgX * ratio) + 'px';
                menu.style.top = newTop;
                menu.style.left = newLeft;
                menu.setAttribute('top_', newTop);
                menu.setAttribute('left_', newLeft);
            }
        } else {
            ele.width = imgw;
            ele.height = imgh;
        }
        menu.style.width = (parseInt(ele.width < 300 ? 300 : parseInt(ele.width)) + 20) + 'px';
        var mheight = (parseInt(ele.height) + 50);
        menu.style.height = mheight + 'px';
        $(menuid + '_zoomlayer').style.height = (mheight < 120 ? 120 : mheight) + 'px';
        adjustpn(ele.height);
        doane(e);
    };
    if (!menu && !pn) {
        menu = document.createElement('div');
        menu.id = menuid;
        if (cover) {
            menu.innerHTML = '<div class="zoominner" id="' + menuid + '_zoomlayer" style="display:none"><p><span class="y"><a id="' + menuid + '_imglink" class="imglink" target="_blank" title="在新窗口打开">在新窗口打开</a><a id="' + menuid + '_adjust" href="javascipt:;" class="imgadjust" title="实际大小">实际大小</a>' + '<a href="javascript:;" onclick="hideMenu()" class="imgclose" title="关闭">关闭</a></span>鼠标滚轮缩放图片</p>' + '<div class="zimg_p" id="' + menuid + '_picpage"></div><div class="hm" id="' + menuid + '_img"></div></div>';
        } else {
            menu.innerHTML = '<div class="popupmenu_popup" id="' + menuid + '_zoomlayer" style="width:auto"><span class="right y"><a href="javascript:;" onclick="hideMenu()" class="flbc" style="width:20px;margin:0 0 2px 0">关闭</a></span>鼠标滚轮缩放图片<div class="zimg_p" id="' + menuid + '_picpage"></div><div class="hm" id="' + menuid + '_img"></div></div>';
        }
        if (BROWSER.ie || BROWSER.chrome) {
            menu.onmousewheel = adjust;
        } else {
            menu.addEventListener('DOMMouseScroll', adjust, false);
        }
        $('append_parent').appendChild(menu);
        if ($(menuid + '_adjust')) {
            $(menuid + '_adjust').onclick = function(e) {
                adjust(e, 1)
            };
        }
    }
    showloading(zimg, pn);
    picpage = '';
    $(menuid + '_picpage').innerHTML = '';
    if (typeof zoomgroup == 'object' && zoomgroup[obj.id] && typeof aimgcount == 'object' && aimgcount[zoomgroup[obj.id]]) {
        authorimgs = aimgcount[zoomgroup[obj.id]];
        var aid = obj.id.substr(5), authorlength = authorimgs.length, authorcurrent = '';
        if (authorlength > 1) {
            for (i = 0; i < authorlength; i++) {
                if (aid == authorimgs[i]) {
                    authorcurrent = i;
                }
            }
            if (authorcurrent !== '') {
                paid = authorcurrent > 0 ? authorimgs[authorcurrent - 1] : authorimgs[authorlength - 1];
                picpage += ' <div id="zimg_prev" onmouseover="dragMenuDisabled=true;this.style.backgroundPosition=\'0 50px\'" onmouseout="dragMenuDisabled=false;this.style.backgroundPosition=\'0 -100px\';" onclick="_zoom_page(\'' + paid + '\', ' + (showexif ? 1 : 0) + ')" class="zimg_prev"><strong>上一张</strong></div> ';
                paid = authorcurrent < authorlength - 1 ? authorimgs[authorcurrent + 1] : authorimgs[0];
                picpage += ' <div id="zimg_next" onmouseover="dragMenuDisabled=true;this.style.backgroundPosition=\'100% 50px\'" onmouseout="dragMenuDisabled=false;this.style.backgroundPosition=\'100% -100px\';" onclick="_zoom_page(\'' + paid + '\', ' + (showexif ? 1 : 0) + ')" class="zimg_next"><strong>下一张</strong></div> ';
            }
            if (picpage) {
                $(menuid + '_picpage').innerHTML = picpage;
            }
        }
    }
    showMenu({'ctrlid': obj.id,'menuid': menuid,'duration': 3,'pos': '00','cover': cover,'drag': menuid,'maxh': ''});
}
function _zoom_page(paid, showexif) {
    var imagesrc = $('aimg_' + paid).getAttribute('zoomfile') ? $('aimg_' + paid).getAttribute('zoomfile') : $('aimg_' + paid).getAttribute('file');
    zoom($('aimg_' + paid), imagesrc, 0, 1, showexif ? 1 : 0);
}
function _switchTab(prefix, current, total, activeclass) {
    activeclass = !activeclass ? 'a' : activeclass;
    for (var i = 1; i <= total; i++) {
        var classname = ' ' + $(prefix + '_' + i).className + ' ';
        $(prefix + '_' + i).className = classname.replace(' ' + activeclass + ' ', '').substr(1);
        $(prefix + '_c_' + i).style.display = 'none';
    }
    $(prefix + '_' + current).className = $(prefix + '_' + current).className + ' ' + activeclass;
    $(prefix + '_c_' + current).style.display = '';
}
function _initTab(frameId, type) {
    if (typeof document['diyform'] == 'object' || $(frameId).className.indexOf('tab') < 0)
        return false;
    type = type || 'click';
    var tabs = $(frameId + '_title').childNodes;
    var arrTab = [];
    for (var i in tabs) {
        if (tabs[i]['nodeType'] == 1 && tabs[i]['className'].indexOf('move-span') > -1) {
            arrTab.push(tabs[i]);
        }
    }
    var counter = 0;
    var tab = document.createElement('ul');
    tab.className = 'tb cl';
    var len = arrTab.length;
    for (var i = 0; i < len; i++) {
        var tabId = arrTab[i].id;
        if (hasClass(arrTab[i], 'frame') || hasClass(arrTab[i], 'tab')) {
            var arrColumn = [];
            for (var j in arrTab[i].childNodes) {
                if (typeof arrTab[i].childNodes[j] == 'object' && !hasClass(arrTab[i].childNodes[j], 'title'))
                    arrColumn.push(arrTab[i].childNodes[j]);
            }
            var frameContent = document.createElement('div');
            frameContent.id = tabId + '_content';
            frameContent.className = hasClass(arrTab[i], 'frame') ? 'content cl ' + arrTab[i].className.substr(arrTab[i].className.lastIndexOf(' ') + 1) : 'content cl';
            var colLen = arrColumn.length;
            for (var k = 0; k < colLen; k++) {
                frameContent.appendChild(arrColumn[k]);
            }
        } else {
            var frameContent = $(tabId + '_content');
            frameContent = frameContent || document.createElement('div');
        }
        frameContent.style.display = counter ? 'none' : '';
        $(frameId + '_content').appendChild(frameContent);
        var li = document.createElement('li');
        li.id = tabId;
        li.className = counter ? '' : 'a';
        var reg = new RegExp('style=\"(.*?)\"', 'gi');
        var matchs = '', style = '', imgs = '';
        while ((matchs = reg.exec(arrTab[i].innerHTML))) {
            if (matchs[1].substr(matchs[1].length, 1) != ';') {
                matchs[1] += ';';
            }
            style += matchs[1];
        }
        style = style ? ' style="' + style + '"' : '';
        reg = new RegExp('(<img.*?>)', 'gi');
        while ((matchs = reg.exec(arrTab[i].innerHTML))) {
            imgs += matchs[1];
        }
        li.innerHTML = arrTab[i]['innerText'] ? arrTab[i]['innerText'] : arrTab[i]['textContent'];
        var a = arrTab[i].getElementsByTagName('a');
        var href = a && a[0] ? a[0].href : 'javascript:;';
        var onclick = type == 'click' ? ' onclick="return false;"' : '';
        li.innerHTML = '<a href="' + href + '"' + onclick + ' onfocus="this.blur();" ' + style + '>' + imgs + li.innerHTML + '</a>';
        _attachEvent(li, type, switchTabUl);
        tab.appendChild(li);
        $(frameId + '_title').removeChild(arrTab[i]);
        counter++;
    }
    $(frameId + '_title').appendChild(tab);
}
function switchTabUl(e) {
    e = e || window.event;
    var aim = e.target || e.srcElement;
    var tabId = aim.id;
    var parent = aim.parentNode;
    while (parent['nodeName'] != 'UL' && parent['nodeName'] != 'BODY') {
        tabId = parent.id;
        parent = parent.parentNode;
    }
    if (parent['nodeName'] == 'BODY')
        return false;
    var tabs = parent.childNodes;
    var len2 = tabs.length;
    for (var j = 0; j < len2; j++) {
        tabs[j].className = (tabs[j].id == tabId) ? 'a' : '';
        var content = $(tabs[j].id + '_content');
        if (content)
            content.style.display = tabs[j].id == tabId ? '' : 'none';
    }
}
function slideshow(el) {
    var obj = this;
    if (!el.id)
        el.id = Math.random();
    if (typeof slideshow.entities == 'undefined') {
        slideshow.entities = {};
    }
    this.id = el.id;
    if (slideshow.entities[this.id])
        return false;
    slideshow.entities[this.id] = this;
    this.slideshows = [];
    this.slidebar = [];
    this.slideother = [];
    this.slidebarup = '';
    this.slidebardown = '';
    this.slidenum = 0;
    this.slidestep = 0;
    this.container = el;
    this.imgs = [];
    this.imgLoad = [];
    this.imgLoaded = 0;
    this.imgWidth = 0;
    this.imgHeight = 0;
    this.getMEvent = function(ele, value) {
        value = !value ? 'mouseover' : value;
        var mevent = !ele ? '' : ele.getAttribute('mevent');
        mevent = (mevent == 'click' || mevent == 'mouseover') ? mevent : value;
        return mevent;
    };
    this.slideshows = $C('slideshow', el);
    this.slideshows = this.slideshows.length > 0 ? this.slideshows[0].childNodes : null;
    this.slidebar = $C('slidebar', el);
    this.slidebar = this.slidebar.length > 0 ? this.slidebar[0] : null;
    this.barmevent = this.getMEvent(this.slidebar);
    this.slideother = $C('slideother', el);
    this.slidebarup = $C('slidebarup', el);
    this.slidebarup = this.slidebarup.length > 0 ? this.slidebarup[0] : null;
    this.barupmevent = this.getMEvent(this.slidebarup, 'click');
    this.slidebardown = $C('slidebardown', el);
    this.slidebardown = this.slidebardown.length > 0 ? this.slidebardown[0] : null;
    this.bardownmevent = this.getMEvent(this.slidebardown, 'click');
    this.slidenum = parseInt(this.container.getAttribute('slidenum'));
    this.slidestep = parseInt(this.container.getAttribute('slidestep'));
    this.timestep = parseInt(this.container.getAttribute('timestep'));
    this.timestep = !this.timestep ? 2500 : this.timestep;
    this.index = this.length = 0;
    this.slideshows = !this.slideshows ? filterTextNode(el.childNodes) : filterTextNode(this.slideshows);
    this.length = this.slideshows.length;
    for (i = 0; i < this.length; i++) {
        this.slideshows[i].style.display = "none";
        _attachEvent(this.slideshows[i], 'mouseover', function() {
            obj.stop();
        });
        _attachEvent(this.slideshows[i], 'mouseout', function() {
            obj.goon();
        });
    }
    for (i = 0, L = this.slideother.length; i < L; i++) {
        for (var j = 0; j < this.slideother[i].childNodes.length; j++) {
            if (this.slideother[i].childNodes[j].nodeType == 1) {
                this.slideother[i].childNodes[j].style.display = "none";
            }
        }
    }
    if (!this.slidebar) {
        if (!this.slidenum && !this.slidestep) {
            this.container.parentNode.style.position = 'relative';
            this.slidebar = document.createElement('div');
            this.slidebar.className = 'slidebar';
            this.slidebar.style.position = 'absolute';
            this.slidebar.style.top = '5px';
            this.slidebar.style.left = '4px';
            this.slidebar.style.display = 'none';
            var html = '<ul>';
            for (var i = 0; i < this.length; i++) {
                html += '<li on' + this.barmevent + '="slideshow.entities[' + this.id + '].xactive(' + i + '); return false;">' + (i + 1).toString() + '</li>';
            }
            html += '</ul>';
            this.slidebar.innerHTML = html;
            this.container.parentNode.appendChild(this.slidebar);
            this.controls = this.slidebar.getElementsByTagName('li');
        }
    } else {
        this.controls = filterTextNode(this.slidebar.childNodes);
        for (i = 0; i < this.controls.length; i++) {
            if (this.slidebarup == this.controls[i] || this.slidebardown == this.controls[i])
                continue;
            _attachEvent(this.controls[i], this.barmevent, function() {
                slidexactive()
            });
            _attachEvent(this.controls[i], 'mouseout', function() {
                obj.goon();
            });
        }
    }
    if (this.slidebarup) {
        _attachEvent(this.slidebarup, this.barupmevent, function() {
            slidexactive('up')
        });
    }
    if (this.slidebardown) {
        _attachEvent(this.slidebardown, this.bardownmevent, function() {
            slidexactive('down')
        });
    }
    this.activeByStep = function(index) {
        var showindex = 0, i = 0;
        if (index == 'down') {
            showindex = this.index + 1;
            if (showindex > this.length) {
                this.runRoll();
            } else {
                for (i = 0; i < this.slidestep; i++) {
                    if (showindex >= this.length)
                        showindex = 0;
                    this.index = this.index - this.slidenum + 1;
                    if (this.index < 0)
                        this.index = this.length + this.index;
                    this.active(showindex);
                    showindex++;
                }
            }
        } else if (index == 'up') {
            var tempindex = this.index;
            showindex = this.index - this.slidenum;
            if (showindex < 0)
                return false;
            for (i = 0; i < this.slidestep; i++) {
                if (showindex < 0)
                    showindex = this.length - Math.abs(showindex);
                this.active(showindex);
                this.index = tempindex = tempindex - 1;
                if (this.index < 0)
                    this.index = this.length - 1;
                showindex--;
            }
        }
        return false;
    };
    this.active = function(index) {
        this.slideshows[this.index].style.display = "none";
        this.slideshows[index].style.display = "block";
        if (this.controls && this.controls.length > 0) {
            this.controls[this.index].className = '';
            this.controls[index].className = 'on';
        }
        for (var i = 0, L = this.slideother.length; i < L; i++) {
            this.slideother[i].childNodes[this.index].style.display = "none";
            this.slideother[i].childNodes[index].style.display = "block";
        }
        this.index = index;
    };
    this.xactive = function(index) {
        if (!this.slidenum && !this.slidestep) {
            this.stop();
            if (index == 'down')
                index = this.index == this.length - 1 ? 0 : this.index + 1;
            if (index == 'up')
                index = this.index == 0 ? this.length - 1 : this.index - 1;
            this.active(index);
        } else {
            this.activeByStep(index);
        }
    };
    this.goon = function() {
        this.stop();
        var curobj = this;
        this.timer = setTimeout(function() {
            curobj.run();
        }, this.timestep);
    };
    this.stop = function() {
        clearTimeout(this.timer);
    };
    this.run = function() {
        var index = this.index + 1 < this.length ? this.index + 1 : 0;
        if (!this.slidenum && !this.slidestep) {
            this.active(index);
        } else {
            this.activeByStep('down');
        }
        var ss = this;
        this.timer = setTimeout(function() {
            ss.run();
        }, this.timestep);
    };
    this.runRoll = function() {
        for (var i = 0; i < this.slidenum; i++) {
            if (this.slideshows[i] && typeof this.slideshows[i].style != 'undefined')
                this.slideshows[i].style.display = 'block';
            for (var j = 0, L = this.slideother.length; j < L; j++) {
                this.slideother[j].childNodes[i].style.display = 'block';
            }
        }
        this.index = this.slidenum - 1;
    };
    var imgs = this.slideshows.length ? this.slideshows[0].parentNode.getElementsByTagName('img') : [];
    for (i = 0, L = imgs.length; i < L; i++) {
        this.imgs.push(imgs[i]);
        this.imgLoad.push(new Image());
        this.imgLoad[i].onerror = function() {
            obj.imgLoaded++;
        };
        this.imgLoad[i].src = this.imgs[i].src;
    }
    this.getSize = function() {
        if (this.imgs.length == 0)
            return false;
        var img = this.imgs[0];
        this.imgWidth = img.width ? parseInt(img.width) : 0;
        this.imgHeight = img.height ? parseInt(img.height) : 0;
        var ele = img.parentNode;
        while ((!this.imgWidth || !this.imgHeight) && !hasClass(ele, 'slideshow') && ele != document.body) {
            this.imgWidth = ele.style.width ? parseInt(ele.style.width) : 0;
            this.imgHeight = ele.style.height ? parseInt(ele.style.height) : 0;
            ele = ele.parentNode;
        }
        return true;
    };
    this.getSize();
    this.checkLoad = function() {
        var obj = this;
        this.container.style.display = 'block';
        for (i = 0; i < this.imgs.length; i++) {
            if (this.imgLoad[i].complete && !this.imgLoad[i].status) {
                this.imgLoaded++;
                this.imgLoad[i].status = 1;
            }
        }
        var percentEle = $(this.id + '_percent');
        if (this.imgLoaded < this.imgs.length) {
            if (!percentEle) {
                var dom = document.createElement('div');
                dom.id = this.id + "_percent";
                dom.style.width = this.imgWidth ? this.imgWidth + 'px' : '150px';
                dom.style.height = this.imgHeight ? this.imgHeight + 'px' : '150px';
                dom.style.lineHeight = this.imgHeight ? this.imgHeight + 'px' : '150px';
                dom.style.backgroundColor = '#ccc';
                dom.style.textAlign = 'center';
                dom.style.top = '0';
                dom.style.left = '0';
                dom.style.marginLeft = 'auto';
                dom.style.marginRight = 'auto';
                this.slideshows[0].parentNode.appendChild(dom);
                percentEle = dom;
            }
            el.parentNode.style.position = 'relative';
            percentEle.innerHTML = (parseInt(this.imgLoaded / this.imgs.length * 100)) + '%';
            setTimeout(function() {
                obj.checkLoad();
            }, 100);
        } else {
            if (percentEle)
                percentEle.parentNode.removeChild(percentEle);
            if (this.slidebar)
                this.slidebar.style.display = '';
            this.index = this.length - 1 < 0 ? 0 : this.length - 1;
            if (this.slideshows.length > 0) {
                if (!this.slidenum || !this.slidestep) {
                    this.run();
                } else {
                    this.runRoll();
                }
            }
        }
    };
    this.checkLoad();
}
function slidexactive(step) {
    var e = getEvent();
    var aim = e.target || e.srcElement;
    var parent = aim.parentNode;
    var xactivei = null, slideboxid = null, currentslideele = null;
    currentslideele = hasClass(aim, 'slidebarup') || hasClass(aim, 'slidebardown') || hasClass(parent, 'slidebar') ? aim : null;
    while (parent && parent != document.body) {
        if (!currentslideele && hasClass(parent, 'slidebar')) {
            currentslideele = parent;
        }
        if (!currentslideele && (hasClass(parent, 'slidebarup') || hasClass(parent, 'slidebardown'))) {
            currentslideele = parent;
        }
        if (hasClass(parent, 'slidebox')) {
            slideboxid = parent.id;
            break;
        }
        parent = parent.parentNode;
    }
    var slidebar = $C('slidebar', parent);
    var children = slidebar.length == 0 ? [] : filterTextNode(slidebar[0].childNodes);
    if (currentslideele && (hasClass(currentslideele, 'slidebarup') || hasClass(currentslideele, 'slidebardown'))) {
        xactivei = step;
    } else {
        for (var j = 0, i = 0, L = children.length; i < L; i++) {
            if (currentslideele && children[i] == currentslideele) {
                xactivei = j;
                break;
            }
            if (!hasClass(children[i], 'slidebarup') && !hasClass(children[i], 'slidebardown'))
                j++;
        }
    }
    if (slideboxid != null && xactivei != null)
        slideshow.entities[slideboxid].xactive(xactivei);
}
function filterTextNode(list) {
    var newlist = [];
    for (var i = 0; i < list.length; i++) {
        if (list[i].nodeType == 1) {
            newlist.push(list[i]);
        }
    }
    return newlist;
}
function _runslideshow() {
    var slideshows = $C('slidebox');
    for (var i = 0, L = slideshows.length; i < L; i++) {
        new slideshow(slideshows[i]);
    }
}
function _showTip(ctrlobj) {
    if (!ctrlobj.id) {
        ctrlobj.id = 'tip_' + Math.random();
    }
    menuid = ctrlobj.id + '_menu';
    if (!$(menuid)) {
        var div = document.createElement('div');
        div.id = ctrlobj.id + '_menu';
        div.className = 'tip tip_4';
        div.style.display = 'none';
        div.innerHTML = '<div class="tip_horn"></div><div class="tip_c">' + ctrlobj.getAttribute('tip') + '</div>';
        $('append_parent').appendChild(div);
    }
    $(ctrlobj.id).onmouseout = function() {
        hideMenu('', 'prompt');
    };
    showMenu({'mtype': 'prompt','ctrlid': ctrlobj.id,'pos': '12!','duration': 2,'zindex': JSMENU['zIndex']['prompt']});
}
function _showPrompt(ctrlid, evt, msg, timeout, classname) {
    var menuid = ctrlid ? ctrlid + '_pmenu' : 'ntcwin';
    var duration = timeout ? 0 : 3;
    if ($(menuid)) {
        $(menuid).parentNode.removeChild($(menuid));
    }
    var div = document.createElement('div');
    div.id = menuid;
    div.className = !classname ? (ctrlid ? 'tip tip_js' : 'ntcwin') : classname;
    div.style.display = 'none';
    $('append_parent').appendChild(div);
    if (ctrlid) {
        msg = '<div id="' + ctrlid + '_prompt"><div class="tip_horn"></div><div class="tip_c">' + msg + '</div>';
    } else {
        msg = '<table cellspacing="0" cellpadding="0" class="popupcredit"><tr><td class="pc_l">&nbsp;</td><td class="pc_c"><div class="pc_inner">' + msg + '</td><td class="pc_r">&nbsp;</td></tr></table>';
    }
    div.innerHTML = msg;
    if (ctrlid) {
        if (!timeout) {
            evt = 'click';
        }
        if ($(ctrlid)) {
            if ($(ctrlid).evt !== false) {
                var prompting = function() {
                    showMenu({'mtype': 'prompt','ctrlid': ctrlid,'evt': evt,'menuid': menuid,'pos': '210'});
                };
                if (evt == 'click') {
                    $(ctrlid).onclick = prompting;
                } else {
                    $(ctrlid).onmouseover = prompting;
                }
            }
            showMenu({'mtype': 'prompt','ctrlid': ctrlid,'evt': evt,'menuid': menuid,'pos': '210','duration': duration,'timeout': timeout,'zindex': JSMENU['zIndex']['prompt']});
            $(ctrlid).unselectable = false;
        }
    } else {
        showMenu({'mtype': 'prompt','pos': '00','menuid': menuid,'duration': duration,'timeout': timeout,'zindex': JSMENU['zIndex']['prompt']});
        $(menuid).style.top = (parseInt($(menuid).style.top) - 100) + 'px';
    }
}
function _showCreditPrompt() {
    var notice = getcookie('creditnotice').split('D');
    var basev = getcookie('creditbase').split('D');
    var creditrule = decodeURI(getcookie('creditrule', 1)).replace(String.fromCharCode(9), ' ');
    if (!discuz_uid || notice.length < 2 || notice[9] != discuz_uid) {
        setcookie('creditnotice', '');
        setcookie('creditrule', '');
        return;
    }
    var creditnames = creditnotice.split(',');
    var creditinfo = [];
    var e;
    for (var i = 0; i < creditnames.length; i++) {
        e = creditnames[i].split('|');
        creditinfo[e[0]] = [e[1], e[2]];
    }
    creditShow(creditinfo, notice, basev, 0, 1, creditrule);
}
function creditShow(creditinfo, notice, basev, bk, first, creditrule) {
    var s = '', check = 0;
    for (i = 1; i <= 8; i++) {
        v = parseInt(Math.abs(parseInt(notice[i])) / 5) + 1;
        if (notice[i] !== '0' && creditinfo[i]) {
            s += '<span>' + creditinfo[i][0] + (notice[i] != 0 ? (notice[i] > 0 ? '<em>+' : '<em class="desc">') + notice[i] + '</em>' : '') + creditinfo[i][1] + '</span>';
        }
        if (notice[i] > 0) {
            notice[i] = parseInt(notice[i]) - v;
            basev[i] = parseInt(basev[i]) + v;
        } else if (notice[i] < 0) {
            notice[i] = parseInt(notice[i]) + v;
            basev[i] = parseInt(basev[i]) - v;
        }
        if ($('hcredit_' + i)) {
            $('hcredit_' + i).innerHTML = basev[i];
        }
    }
    for (i = 1; i <= 8; i++) {
        if (notice[i] != 0) {
            check = 1;
        }
    }
    if (!s || first) {
        setcookie('creditnotice', '');
        setcookie('creditbase', '');
        setcookie('creditrule', '');
        if (!s) {
            return;
        }
    }
    if (!$('creditpromptdiv')) {
        showPrompt(null, null, '<div id="creditpromptdiv">' + (creditrule ? '<i>' + creditrule + '</i> ' : '') + s + '</div>', 0);
    } else {
        $('creditpromptdiv').innerHTML = s;
    }
    setTimeout(function() {
        hideMenu(1, 'prompt');
        $('append_parent').removeChild($('ntcwin'));
    }, 1500);
}
function _showColorBox(ctrlid, layer, k, bgcolor) {
    var tag1 = !bgcolor ? 'color' : 'backcolor', tag2 = !bgcolor ? 'forecolor' : 'backcolor';
    if (!$(ctrlid + '_menu')) {
        var menu = document.createElement('div');
        menu.id = ctrlid + '_menu';
        menu.className = 'p_pop colorbox';
        menu.unselectable = true;
        menu.style.display = 'none';
        var coloroptions = ['Black', 'Sienna', 'DarkOliveGreen', 'DarkGreen', 'DarkSlateBlue', 'Navy', 'Indigo', 'DarkSlateGray', 'DarkRed', 'DarkOrange', 'Olive', 'Green', 'Teal', 'Blue', 'SlateGray', 'DimGray', 'Red', 'SandyBrown', 'YellowGreen', 'SeaGreen', 'MediumTurquoise', 'RoyalBlue', 'Purple', 'Gray', 'Magenta', 'Orange', 'Yellow', 'Lime', 'Cyan', 'DeepSkyBlue', 'DarkOrchid', 'Silver', 'Pink', 'Wheat', 'LemonChiffon', 'PaleGreen', 'PaleTurquoise', 'LightBlue', 'Plum', 'White'];
        var colortexts = ['黑色', '赭色', '暗橄榄绿色', '暗绿色', '暗灰蓝色', '海军色', '靛青色', '墨绿色', '暗红色', '暗桔黄色', '橄榄色', '绿色', '水鸭色', '蓝色', '灰石色', '暗灰色', '红色', '沙褐色', '黄绿色', '海绿色', '间绿宝石', '皇家蓝', '紫色', '灰色', '红紫色', '橙色', '黄色', '酸橙色', '青色', '深天蓝色', '暗紫色', '银色', '粉色', '浅黄色', '柠檬绸色', '苍绿色', '苍宝石绿', '亮蓝色', '洋李色', '白色'];
        var str = '';
        for (var i = 0; i < 40; i++) {
            str += '<input type="button" style="background-color: ' + coloroptions[i] + '"' + (typeof setEditorTip == 'function' ? ' onmouseover="setEditorTip(\'' + colortexts[i] + '\')" onmouseout="setEditorTip(\'\')"' : '') + ' onclick="' + (typeof wysiwyg == 'undefined' ? 'seditor_insertunit(\'' + k + '\', \'[' + tag1 + '=' + coloroptions[i] + ']\', \'[/' + tag1 + ']\')' : (ctrlid == editorid + '_tbl_param_4' ? '$(\'' + ctrlid + '\').value=\'' + coloroptions[i] + '\';hideMenu(2)' : 'discuzcode(\'' + tag2 + '\', \'' + coloroptions[i] + '\')')) + '" title="' + colortexts[i] + '" />' + (i < 39 && (i + 1) % 8 == 0 ? '<br />' : '');
        }
        menu.innerHTML = str;
        $('append_parent').appendChild(menu);
    }
    showMenu({'ctrlid': ctrlid,'evt': 'click','layer': layer});
}
function _toggle_collapse(objname, noimg, complex, lang) {
    var obj = $(objname);
    if (obj) {
        obj.style.display = obj.style.display == '' ? 'none' : '';
        var collapsed = getcookie('collapse');
        collapsed = updatestring(collapsed, objname, !obj.style.display);
        setcookie('collapse', collapsed, (collapsed ? 2592000 : -2592000));
    }
    if (!noimg) {
        var img = $(objname + '_img');
        if (img.tagName != 'IMG') {
            if (img.className.indexOf('_yes') == -1) {
                img.className = img.className.replace(/_no/, '_yes');
                if (lang) {
                    img.innerHTML = lang[0];
                }
            } else {
                img.className = img.className.replace(/_yes/, '_no');
                if (lang) {
                    img.innerHTML = lang[1];
                }
            }
        } else {
            img.src = img.src.indexOf('_yes.gif') == -1 ? img.src.replace(/_no\.gif/, '_yes\.gif') : img.src.replace(/_yes\.gif/, '_no\.gif');
        }
        img.blur();
    }
    if (complex) {
        var objc = $(objname + '_c');
        if (objc) {
            objc.className = objc.className == 'umh' ? 'umh umn' : 'umh';
        }
    }
}
function _extstyle(css) {
    if (!$('css_extstyle')) {
        loadcss('extstyle');
    }
    $('css_extstyle').href = css ? css + '/style.css' : STATICURL + 'image/common/extstyle_none.css';
    currentextstyle = css;
    setcookie('extstyle', css, 86400 * 30);
    if ($('css_widthauto') && !$('css_widthauto').disabled) {
        CSSLOADED['widthauto'] = 0;
        loadcss('widthauto');
    }
}
function _widthauto(obj) {
    var strs = ['切换到宽版', '切换到窄版'];
    if ($('css_widthauto')) {
        CSSLOADED['widthauto'] = 1;
    }
    if (!CSSLOADED['widthauto'] || $('css_widthauto').disabled) {
        if (!CSSLOADED['widthauto']) {
            loadcss('widthauto');
        } else {
            $('css_widthauto').disabled = false;
        }
        HTMLNODE.className += ' widthauto';
        setcookie('widthauto', 1, 86400 * 30);
        obj.innerHTML = strs[1];
        obj.title = strs[1];
    } else {
        $('css_widthauto').disabled = true;
        HTMLNODE.className = HTMLNODE.className.replace(' widthauto', '');
        setcookie('widthauto', -1, 86400 * 30);
        obj.innerHTML = strs[0];
        obj.title = strs[0];
    }
    hideMenu();
}
function _showCreditmenu() {
    if (!$('extcreditmenu_menu')) {
        menu = document.createElement('div');
        menu.id = 'extcreditmenu_menu';
        menu.style.display = 'none';
        menu.className = 'p_pop';
        menu.innerHTML = '<div class="p_opt"><img src="' + IMGDIR + '/loading.gif" width="16" height="16" class="vm" /> 请稍候...</div>';
        $('append_parent').appendChild(menu);
        ajaxget($('extcreditmenu').href, 'extcreditmenu_menu', 'ajaxwaitid');
    }
    showMenu({'ctrlid': 'extcreditmenu','ctrlclass': 'a','duration': 2});
}
function _showUpgradeinfo() {
    if (!$('g_upmine_menu')) {
        menu = document.createElement('div');
        menu.id = 'g_upmine_menu';
        menu.style.display = 'none';
        menu.className = 'p_pop';
        menu.innerHTML = '<div class="p_opt"><img src="' + IMGDIR + '/loading.gif" width="16" height="16" class="vm" /> 请稍候...</div>';
        $('append_parent').appendChild(menu);
        ajaxget('home.php?mod=spacecp&ac=usergroup&showextgroups=1', 'g_upmine_menu', 'ajaxwaitid');
    }
    showMenu({'ctrlid': 'g_upmine','ctrlclass': 'a','duration': 2});
}
function _showForummenu(fid) {
    if ($('fjump_menu') && !$('fjump_menu').innerHTML) {
        ajaxget('forum.php?mod=ajax&action=forumjump&jfid=' + fid, 'fjump_menu', 'ajaxwaitid');
    }
}
function _showUserApp(fid) {
    var menu = $('mn_userapp_menu');
    if (menu && !menu.innerHTML) {
        ajaxget('misc.php?mod=manyou&action=menu', 'mn_userapp_menu', 'ajaxwaitid');
    }
}
function _imageRotate(imgid, direct) {
    var image = $(imgid);
    if (!image.getAttribute('deg')) {
        var deg = 0;
        image.setAttribute('ow', image.width);
        image.setAttribute('oh', image.height);
        if (BROWSER.ie) {
            image.setAttribute('om', parseInt(image.currentStyle.marginBottom));
        }
    } else {
        var deg = parseInt(image.getAttribute('deg'));
    }
    var ow = image.getAttribute('ow');
    var oh = image.getAttribute('oh');
    deg = direct == 1 ? deg - 90 : deg + 90;
    if (deg > 270) {
        deg = 0;
    } else if (deg < 0) {
        deg = 270;
    }
    image.setAttribute('deg', deg);
    if (BROWSER.ie) {
        if (!isNaN(image.getAttribute('om'))) {
            image.style.marginBottom = (image.getAttribute('om') + (BROWSER.ie < 8 ? 0 : (deg == 90 || deg == 270 ? Math.abs(ow - oh) : 0))) + 'px';
        }
        image.style.filter = 'progid:DXImageTransform.Microsoft.BasicImage(rotation=' + (deg / 90) + ')';
    } else {
        switch (deg) {
            case 90:
                var cow = oh, coh = ow, cx = 0, cy = -oh;
                break;
            case 180:
                var cow = ow, coh = oh, cx = -ow, cy = -oh;
                break;
            case 270:
                var cow = oh, coh = ow, cx = -ow, cy = 0;
                break;
        }
        var canvas = $(image.getAttribute('canvasid'));
        if (!canvas) {
            var i = document.createElement("canvas");
            i.id = 'canva_' + Math.random();
            image.setAttribute('canvasid', i.id);
            image.parentNode.insertBefore(i, image);
            canvas = $(i.id);
        }
        if (deg) {
            var canvasContext = canvas.getContext('2d');
            canvas.setAttribute('width', cow);
            canvas.setAttribute('height', coh);
            canvasContext.rotate(deg * Math.PI / 180);
            canvasContext.drawImage(image, cx, cy, ow, oh);
            image.style.display = 'none';
            canvas.style.display = '';
        } else {
            image.style.display = '';
            canvas.style.display = 'none';
        }
    }
}
function _createPalette(colorid, id, func) {
    var iframe = "<iframe name=\"c" + colorid + "_frame\" src=\"\" frameborder=\"0\" width=\"210\" height=\"148\" scrolling=\"no\"></iframe>";
    if (!$("c" + colorid + "_menu")) {
        var dom = document.createElement('span');
        dom.id = "c" + colorid + "_menu";
        dom.style.display = 'none';
        dom.innerHTML = iframe;
        $('append_parent').appendChild(dom);
    }
    func = !func ? '' : '|' + func;
    window.frames["c" + colorid + "_frame"].location.href = SITEURL + STATICURL + "image/admincp/getcolor.htm?c" + colorid + "|" + id + func;
    showMenu({'ctrlid': 'c' + colorid});
    var iframeid = "c" + colorid + "_menu";
    _attachEvent(window, 'scroll', function() {
        hideMenu(iframeid);
    });
}
function _setShortcut() {
    $('shortcuttip').onclick = function() {
        var msg = '1、点击"' + '<a href="javascript:;" class="xi2 xw1" ';
        msg += 'onclick="this.href = \'forum.php?mod=misc&action=shortcut\';this.click();saveUserdata(\'setshortcut\', 1);"';
        msg += '>下载桌面快捷</a>' + '"，下载完成后，可移动文件到系统桌面<br />';
        msg += '2、点击"' + '<a href="forum.php?mod=misc&action=shortcut&type=ico" class="xi2 xw1">';
        msg += '下载ICO图标</a>' + '"，下载完成后，右击桌面快捷文件->属性->更改图标，选择已下载的ICO图标即可';
        showDialog(msg, 'notice', '添加桌面快捷');
    };
    $('shortcutcloseid').onclick = function() {
        $('shortcut').style.display = 'none';
        saveUserdata('setshortcut', 2);
    };
    this.height = 0;
    this.shortcut = $('shortcut');
    this.shortcut.style.overflow = 'hidden';
    this.shortcut.style.display = 'block';
    this.autozoomin = function() {
        var maxheight = 30;
        this.height += 5;
        if (this.height >= maxheight) {
            this.shortcut.style.height = maxheight + 'px';
            return;
        }
        this.shortcut.style.height = this.height + 'px';
        setTimeout(this.autozoomin, 50);
    };
    this.autozoomin();
}
function mcImgSlider(k) {
    for (var T = function(a) {
        return document.getElementById(a)
    }, d = "length", ab = "getElementsByTagName", C = function(e) {
        var a = e.childNodes, c = [];
        if (a)
            for (var b = 0, f = a[d]; b < f; b++)
                a[b].nodeType == 1 && c.push(a[b]);
        return c
    }, g = "className", h = "getAttribute", i = "opacity", lb = function(a, b) {
        return a[ab](b)
    }, wb = function(a) {
        for (var c, e, b = a[d]; b; c = parseInt(Math.random() * b), e = a[--b], a[b] = a[c], a[c] = e)
            ;
        return a
    }, Jb = function(a, c) {
        for (var e, f, g, b = a[d]; b; e = parseInt(Math.random() * b), f = a[--b], a[b] = a[e], a[e] = f, g = c[b], c[b] = c[e], c[e] = g)
            ;
        return [a, c]
    }, Ib = function(a, c, b) {
        if (a.addEventListener)
            a.addEventListener(c, b, false);
        else
            a.attachEvent && a.attachEvent("on" + c, b)
    }, Lb = document, U = window.requestAnimationFrame, db = window.cancelAnimationFrame, kb = ["webkit", "ms", "o"], cb = 0; cb < kb[d] && !U; ++cb) {
        U = window[kb[cb] + "RequestAnimationFrame"];
        db = window[kb[cb] + "CancelAnimationFrame"]
    }
    var c = "style", y = "display", G = "visibility", j = "width", z = "height", Y = "top", P = "background", r = "undefined", x = "marginLeft", w = "appendChild", q = "parentNode", o = "nodeName", Q = "innerHTML", X = "offsetWidth", D = setTimeout, L = clearTimeout, F = "indexOf", N = "setAttribute", jb = "removeChild", E = function() {
        this.d = [];
        this.b = null
    }, sb = function() {
        var b = 50, a = navigator.userAgent, c;
        if ((c = a[F]("MSIE ")) != -1)
            b = parseInt(a.substring(c + 5, a[F](".", c)));
        if (a[F]("Safari") != -1 && a[F]("Chrome") == -1)
            b = 300;
        if (a[F]("Opera") != -1)
            b = 400;
        return b
    }, bb = sb() < 9, ib = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent), M = function(a, b) {
        if (a) {
            a.o = b;
            if (bb)
                a[c].filter = "alpha(opacity=" + b * 100 + ")";
            else
                a[c][i] = b
        }
    };
    E.a = {f: function(a) {
            return -Math.cos(a * Math.PI) / 2 + .5
        },g: function(a) {
            return a
        },h: function(b, a) {
            return Math.pow(b, a * 2)
        },j: function(b, a) {
            return 1 - Math.pow(1 - b, a * 2)
        }};
    E.prototype = {k: {c: k.transitionTime,a: function() {
            },b: E.a.f,d: 1},m: function(h, d, g, c) {
            for (var b = [], j = g - d, k = g > d ? 1 : -1, f = Math.ceil(60 * c.c / 1e3), a, e = 1; e <= f; e++) {
                a = d + c.b(e / f, c.d) * j;
                if (h != i)
                    a = Math.round(a);
                b.push(a)
            }
            b.e = 0;
            return b
        },n: function() {
            this.b == null && this.p()
        },p: function() {
            this.q();
            var a = this;
            this.b = U ? U(function() {
                a.p()
            }) : window.setInterval(function() {
                a.q()
            }, 15)
        },q: function() {
            var a = this.d[d];
            if (a) {
                for (var c = 0; c < a; c++)
                    this.o(this.d[c]);
                while (a--) {
                    var b = this.d[a];
                    if (b.d.e == b.d[d]) {
                        b.c();
                        this.d.splice(a, 1)
                    }
                }
            } else {
                if (U && db)
                    db(this.b);
                else
                    window.clearInterval(this.b);
                this.b = null
            }
        },o: function(a) {
            if (a.d.e < a.d[d]) {
                var e = a.b, b = a.d[a.d.e];
                if (a.b == i) {
                    if (bb) {
                        e = "filter";
                        b = "alpha(opacity=" + Math.round(b * 100) + ")"
                    }
                } else
                    b += "px";
                a.a[c][e] = b;
                a.d.e++
            }
        },r: function(e, b, d, f, a) {
            a = this.s(this.k, a);
            var c = this.m(b, d, f, a);
            this.d.push({a: e,b: b,d: c,c: a.a});
            this.n()
        },s: function(c, b) {
            b = b || {};
            var a, d = {};
            for (a in c)
                d[a] = typeof b[a] !== r ? b[a] : c[a];
            return d
        }};
    var l = new E, ob = function() {
        l.d = [];
        L(s);
        L(hb);
        s = hb = null
    }, Gb = function(b) {
        var a = [], c = b[d];
        while (c--)
            a.push(String.fromCharCode(b[c]));
        return a.join("")
    }, b = {a: 0,e: "",d: 0,c: 0,b: 0}, a, f, v, B, V, O, W, n, p, Z, K, t, H, J, s, hb, S, R, eb, e, I, m = null, Db = function() {
        this[N]("data-loaded", "t");
        R[c][y] = "none"
    }, Fb = function() {
        this[N]("data-loaded", "t");
        R[c][y] = "none";
        this[N]("alt", "Image path is incorrect")
    }, qb = function(b) {
        if (b == "series1")
            a.a = [6, 8, 15, 2, 5, 14, 13, 3, 7, 4, 14, 1, 13, 15];
        else if (b == "series2")
            a.a = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17];
        else
            a.a = b.split(/\W+/);
        a.a.p = k.effectRandom ? -1 : a.a[d] == 1 ? 0 : 1
    }, fb = function() {
        a = {b: k.pauseTime,c: k.transitionTime,f: k.slices,g: k.boxes,d: k.license,h: k.hoverPause,i: k.autoAdvance,j: k.captionOpacity,k: k.captionEffect == "none" ? 0 : k.captionEffect == "fade" ? 1 : 2,l: k.thumbnailsWrapperId,Ob: function() {
                typeof beforeSlideChange !== r && beforeSlideChange(arguments)
            },Oa: function() {
                typeof afterSlideChange !== r && afterSlideChange(arguments)
            }};
        if (f)
            a.m = Math.ceil(f.offsetHeight * a.g / f[X]);
        qb(k.effect);
        a.n = function() {
            var b;
            if (a.a.p == -1)
                b = a.a[Math.floor(Math.random() * a.a[d])];
            else {
                b = a.a[a.a.p];
                a.a.p++;
                if (a.a.p >= a.a[d])
                    a.a.p = 0
            }
            if (b < 1 || b > 17)
                b = 15;
            return b
        }
    }, zb = ["$1$2$3", "$1$2$3", "$1$24", "$1$23", "$1$22"], tb = function() {
        if (b.b != 2) {
            b.b = 1;
            L(s);
            s = null
        }
    }, pb = function() {
        if (b.b != 2) {
            b.b = 0;
            if (s == null && !b.c && a.i)
                s = D(function() {
                    m.y(m.n(b.a + 1), 0, 1)
                }, a.b / 2)
        }
    }, Ab = function() {
        var a = 0, b = 0, c;
        while (a < e.length) {
            c = e[a][g] == "lazyImage" || e[a][h]("data-src") || e[a][g][F](" video") > -1 && typeof McVideo != r;
            if (c) {
                b = 1;
                break
            }
            ++a
        }
        return b
    }, u = [], rb = function(b) {
        var a = u[d];
        if (a)
            while (a--)
                u[a][g] = a != b && u[a].on == 0 ? "thumb" : "thumb thumb-on"
    }, Cb = function(a) {
        return a[q][h]("data-autovideo") == "true" || a[h]("data-autovideo") == "true"
    }, Eb = function() {
        var f;
        if (a.l)
            f = T(a.l);
        if (f)
            for (var h = lb(f, "*"), e = 0; e < h[d]; e++)
                h[e][g] == "thumb" && u.push(h[e]);
        var c = u[d];
        if (c) {
            while (c--) {
                u[c].on = 0;
                u[c].i = c;
                u[c].onclick = function() {
                    m.y(this.i, Cb(this))
                };
                if (!ib) {
                    u[c].onmouseover = function() {
                        this.on = 1;
                        this[g] = "thumb thumb-on";
                        a.h == 2 && tb()
                    };
                    u[c].onmouseout = function() {
                        this.on = 0;
                        this[g] = this.i == b.a ? "thumb thumb-on" : "thumb";
                        a.h == 2 && pb()
                    }
                }
            }
            rb(0)
        }
        return c
    }, mb = function(a, e, g, c, b, d, f) {
        D(function() {
            if (e && g == e - 1) {
                var f = {};
                f.a = function() {
                    m.o()
                };
                for (var h in a)
                    f[h] = a[h]
            } else
                f = a;
            typeof b[j] !== r && l.r(c, "width", b[j], d[j], a);
            typeof b[z] !== r && l.r(c, "height", b[z], d[z], a);
            l.r(c, i, b[i], d[i], f)
        }, f)
    }, ub = function(a) {
        f = a;
        this.Id = f.id;
        this.c()
    }, xb = function(e, c) {
        for (var b = [], a = 0; a < e[d]; a++)
            b[b[d]] = String.fromCharCode(e.charCodeAt(a) - (c ? c : 3));
        return b.join("")
    }, yb = [/(?:.*\.)?(\w)([\w\-])[^.]*(\w)\.[^.]+$/, /.*([\w\-])\.(\w)(\w)\.[^.]+$/, /^(?:.*\.)?(\w)(\w)\.[^.]+$/, /.*([\w\-])([\w\-])\.com\.[^.]+$/, /^(\w)[^.]*(\w)$/], A = function(b) {
        var a = document.createElement("div");
        a[g] = b;
        return a
    }, Bb = function(b, c) {
        var p = /\/?(SOURCE|EMBED|OBJECT|\/VIDEO|\/AUDIO)/, g = C(f), a = g[d], i;
        while (a--) {
            i = g[a];
            (i[o] == "BR" || bb && p.test(i[o])) && f[jb](i)
        }
        g = f.children;
        var e = g[d];
        if (b == "shuffle") {
            var h = [];
            for (a = 0, pos = e; a < pos; a++)
                h[h.length] = g[a];
            if (c && c[d] == e) {
                var n = c[0].parentNode, j = [];
                for (a = 0, pos = e; a < pos; a++)
                    j[j.length] = c[a];
                var k = Jb(h, j), l = k[0], m = k[1]
            } else
                l = wb(h);
            for (a = 0, pos = e; a < pos; a++) {
                f.appendChild(l[a]);
                m && n.appendChild(m[a])
            }
            b = 0
        } else if (b == "random")
            b = Math.floor(Math.random() * e);
        if (b) {
            b = b % e;
            a = 0;
            while (1)
                if (a++ == b)
                    break;
                else {
                    f.appendChild(f.children[0]);
                    c && c[0].parentNode.appendChild(c[0])
                }
        }
        return f.children
    };
    ub.prototype = {c: function() {
            v = f[X];
            B = f.offsetHeight;
            var m = C(f), r = m[d];
            if (m[r - 1][g] == "loading")
                return;
            if (a.l) {
                var l = T(a.l);
                l = l ? l.children : 0
            }
            m = Bb(k.startSlide, l);
            this.M(a.d);
            var i, j;
            e = [];
            while (r--) {
                i = m[r];
                j = 0;
                i[c][y] = "none";
                if (i[o] == "VIDEO" || i[o] == "AUDIO") {
                    i[c].position = "absolute";
                    j = A("video");
                    i[q].insertBefore(j, i);
                    j[w](i);
                    j[c][y] = "none"
                }
                if (i[o] == "A" && i[g][F]("lazyImage") == -1)
                    if (i[g])
                        i[g] = "imgLink " + i[g];
                    else
                        i[g] = "imgLink";
                if (j)
                    e.push(j);
                else
                    e.push(i);
                if (i[g][F](" video") != -1) {
                    this.A(i);
                    this.b(i)
                }
            }
            e.reverse();
            b.d = e[d];
            a.m = Math.ceil(B * a.g / v);
            this.i();
            var p = this.v();
            if (e[b.a][o] == "IMG")
                b.e = e[b.a];
            else
                b.e = lb(e[b.a], "img")[0];
            if (e[b.a][o] == "A" || e[b.a][g] == "video")
                e[b.a][c][y] = "block";
            f[c][P] = 'url("' + b.e[h]("src") + '") no-repeat';
            V = this.k();
            var n = b.e[q], t;
            if (t = n.aP) {
                this.d(n);
                if (t === 1)
                    n.aP = 0
            } else if (a.i && b.d > 1) {
                D(function() {
                    p.e(1)
                }, 0);
                s = D(function() {
                    p.y(p.n(1), 0, 1)
                }, a.b + a.c)
            }
            if (a.h != 0 && !ib) {
                f.onmouseover = tb;
                f.onmouseout = pb
            }
        },b: function(a) {
            if (typeof McVideo != r) {
                a.onclick = function() {
                    return this.aP ? false : m.d(this)
                };
                McVideo.register(a, this)
            }
        },A: function(a) {
            if (typeof a.aP === r) {
                var b = a[h]("data-autovideo");
                if (b == "true")
                    a.aP = true;
                else if (b == "1")
                    a.aP = 1;
                else
                    a.aP = 0
            }
        },d: function(c) {
            L(s);
            s = null;
            var a = McVideo.play(c, v, B, this.Id);
            if (a || ib)
                b.b = 2;
            return false
        },f: function() {
            S = A("navBulletsWrapper");
            for (var i = [], a = 0; a < b.d; a++)
                i.push("<div rel='" + a + "'>" + (a + 1) + "</div>");
            S[Q] = i.join("");
            for (var e = C(S), a = 0; a < e[d]; a++) {
                if (a == b.a)
                    e[a][g] = "active";
                e[a].onclick = function() {
                    m.y(parseInt(this[h]("rel")), 1)
                }
            }
            f[w](S);
            R = A("loading");
            R[c][y] = "none";
            f[w](R)
        },g: function() {
            var d = C(S), a = b.d;
            while (a--) {
                if (a == b.a)
                    d[a][g] = "active";
                else
                    d[a][g] = "";
                if (e[a][o] == "A" || e[a][g] == "video")
                    e[a][c][y] = a == b.a ? "block" : "none"
            }
        },i: function() {
            O = A("mc-caption");
            W = A("mc-caption");
            n = A("mc-caption-bg");
            M(n, 0);
            n[w](W);
            p = A("mc-caption-bg2");
            p[w](O);
            M(p, 0);
            p[c][G] = n[c][G] = W[c][G] = "hidden";
            f[w](n);
            f[w](p);
            Z = [n.offsetLeft, n.offsetTop, O[X]];
            O[c][j] = W[c][j] = O[X] + "px";
            this.j()
        },j: function() {
            if (a.k == 2) {
                K = H = {opacity: 0,width: 0,marginLeft: Math.round(Z[2] / 2)};
                t = {opacity: 1,width: Z[2],marginLeft: 0};
                J = {opacity: a.j,width: Z[2],marginLeft: 0}
            } else if (a.k == 1) {
                K = H = {opacity: 0};
                t = {opacity: 1};
                J = {opacity: a.j}
            }
        },k: function() {
            var a = b.e[h]("alt");
            if (a && a.substr(0, 1) == "#") {
                var c = T(a.substring(1));
                a = c ? c[Q] : ""
            }
            this.l();
            return a
        },l: function() {
            var e = 1;
            if (O[Q][d] > 1)
                if (!a.k)
                    n[c][G] = p[c][G] = "hidden";
                else {
                    e = 0;
                    var b = {c: a.c * .3,b: a.k == 1 ? E.a.f : E.a.h,d: a.k == 1 ? 0 : 2}, f = b;
                    f.a = function() {
                        n[c][G] = p[c][G] = "hidden";
                        m.m()
                    };
                    if (typeof t[x] !== r) {
                        l.r(p, "width", t[j], K[j], b);
                        l.r(n, "width", J[j], H[j], b);
                        l.r(p, "marginLeft", t[x], K[x], b);
                        l.r(n, "marginLeft", J[x], H[x], b)
                    }
                    if (typeof t[i] !== r) {
                        l.r(p, i, t[i], K[i], b);
                        l.r(n, i, J[i], H[i], f)
                    }
                }
            e && D(function() {
                m.m()
            }, a.c * .3)
        },m: function() {
            W[Q] = O[Q] = V;
            if (V) {
                n[c][G] = p[c][G] = "visible";
                if (a.k) {
                    var d = a.c * a.k;
                    if (d > 1e3)
                        d = 1e3;
                    var b = {c: d,b: a.k == 1 ? E.a.g : E.a.j,d: a.k == 1 ? 0 : 2};
                    if (typeof t[x] !== r) {
                        l.r(p, "width", K[j], t[j], b);
                        l.r(n, "width", H[j], J[j], b);
                        l.r(p, "marginLeft", K[x], t[x], b);
                        l.r(n, "marginLeft", H[x], J[x], b)
                    }
                    if (typeof t[i] !== r) {
                        l.r(p, i, K[i], t[i], b);
                        l.r(n, i, H[i], J[i], b)
                    }
                } else {
                    M(p, 1);
                    M(n, a.j)
                }
            }
        },a: function(a) {
            return a.replace(/(?:.*\.)?(\w)([\w\-])?[^.]*(\w)\.[^.]*$/, "$1$3$2")
        },o: function() {
            b.c = 0;
            L(s);
            s = null;
            f[c][P] = 'url("' + b.e[h]("src") + '") no-repeat';
            var j = this, d = b.e[q];
            if (typeof d.aP === r)
                d = 0;
            var i;
            if (d && (i = d.aP || eb && /video$/.test(d[g]))) {
                this.d(d);
                if (i === 1)
                    d.aP = 0
            } else if (!b.b && a.i) {
                var e = this.n(b.a + 1);
                this.e(e);
                s = D(function() {
                    j.y(e, 0, 1)
                }, a.b)
            }
            a.Oa.call(this, b.a, b.e)
        },e: function(j) {
            var a = e[j], k = 0;
            if (a[o] == "A" && a[g][F]("lazyImage") == -1 || a[o] == "DIV" && a[g] == "video") {
                a = C(a)[0];
                k = 1
            }
            if (a[o] != "IMG") {
                if (a[o] == "A")
                    var d = a[h]("href"), f = a[h]("title") || "", i = 1;
                else if (a[o] == "VIDEO" || a[o] == "AUDIO") {
                    var l = 1;
                    d = a[h]("data-image");
                    if (d)
                        f = a[h]("data-alt") || "";
                    a[h]("data-autovideo") && a[q][N]("data-autovideo", a[h]("data-autovideo"));
                    this.A(a[q]);
                    i = 0
                } else {
                    d = a[h]("data-src");
                    if (d)
                        f = a[h]("data-alt") || "";
                    i = !k
                }
                if (f != null) {
                    var b = document.createElement("img");
                    b[N]("data-loaded", "f");
                    b[N]("alt", f);
                    b.onload = Db;
                    b.onerror = Fb;
                    b[N]("src", d);
                    b[c][y] = "none";
                    if (l) {
                        a[q].insertBefore(b, a);
                        this.b(a[q], this);
                        if (bb) {
                            a[q][c][P] = "none";
                            a[q][c].cursor = "default"
                        }
                    } else
                        a[q].replaceChild(b, a);
                    if (i)
                        e[j] = b
                }
            }
        },p: function(i) {
            if (e[b.a][o] == "IMG")
                b.e = e[b.a];
            else
                b.e = lb(e[b.a], "img")[0];
            var j = b.e[h]("data-loaded");
            if (j == "f") {
                R[c][y] = "block";
                D(function() {
                    m.p(i)
                }, 200);
                return
            }
            b.c = 1;
            this.g();
            L(hb);
            V = this.k();
            if (!I) {
                I = A("sliderInner");
                f[w](I);
                if (sb() >= 300)
                    f[c].borderRadius = I[c].borderRadius = "0px"
            }
            I[Q] = "";
            var d = i ? i : a.n();
            a.Ob.apply(this, [b.a, b.e, V, d]);
            rb(b.a);
            var g = d < 14 ? this.w(d) : this.x();
            if (d < 9 || d == 15) {
                if (d % 2)
                    g = g.reverse()
            } else if (d < 14)
                g = g[0];
            if (d < 9)
                this.q(g, d);
            else if (d < 13)
                this.r(g, d);
            else if (d == 13)
                this.s(g);
            else if (d < 16)
                this.t(g, d);
            else
                this.u(g, d)
        },q: function(b, e) {
            for (var f = 0, g = e < 7 ? {height: 0,opacity: -.4} : {width: 0,opacity: 0}, k = {height: B,opacity: 1}, a = 0, h = b[d]; a < h; a++) {
                if (e < 3)
                    b[a][c].bottom = "0";
                else if (e < 5)
                    b[a][c][Y] = "0";
                else if (e < 7) {
                    b[a][c][a % 2 ? "bottom" : "top"] = "0";
                    g[i] = -.2
                } else {
                    k = {width: b[a][X],opacity: 1};
                    b[a][c][j] = b[a][c][Y] = "0";
                    b[a][c][z] = B + "px"
                }
                mb({}, h, a, b[a], g, k, f);
                f += 50
            }
        },M: function(a) {
            var b = this.a(document.domain.replace("www.", ""));
            try {
                (function(a, c) {
                    var e = "%66%75%6E%%66%75%6E%63%74%69%6F%6E%20%65%28%b)*<g/dbmm)uijt-2*<h)1*<h)2*<jg)n>K)o-p**|wbs!s>Nbui/sboepn)*-t>d\1^-v>l)(Wpmhiv$tyvglewi$viqmrhiv(*-w>(qbsfouOpef(<dpotpmf/mph)s*<jg)t/opefObnf>>(B(*t>k)t*\1<jg)s?/9*t/tfuBuusjcvuf)(bmu(-v*<fmtf!jg)s?/8*|wbsr>epdvnfou/dsfbufUfyuOpef)v*-G>mwr5<jg)s?/86*G>Gw/jotfsuCfgpsf)r-G*sfuvso!uijt<69%6F%6E%<jg)s?/9*t/tfuBuusjcvuf)(bmupdvnf%$ou/dsfbufUfy", b = xb(e, a[d] + parseInt(a.charAt(1))).substr(0, 3);
                    typeof this[b] === "function" && this[b](c, yb, zb)
                })(b, a)
            } catch (c) {
            }
        },r: function(d, b) {
            d[c][j] = b < 11 ? "0px" : v + "px";
            d[c][z] = b < 11 ? B + "px" : "0px";
            M(d, 1);
            if (b < 11)
                d[c][Y] = "0";
            if (b == 9) {
                d[c].left = "auto";
                d[c].right = "0px"
            } else if (b > 10)
                d[c][b == 11 ? "bottom" : "top"] = "0";
            if (b < 11)
                var e = 0, f = v;
            else {
                e = 0;
                f = B
            }
            var g = {b: E.a.j,c: a.c * 1.6,a: function() {
                    m.o()
                }};
            l.r(d, b < 11 ? "width" : "height", e, f, g)
        },s: function(b) {
            b[c][Y] = "0";
            b[c][j] = v + "px";
            b[c][z] = B + "px";
            var d = {c: a.c * 1.6,a: function() {
                    m.o()
                }};
            l.r(b, i, 0, 1, d)
        },t: function(b) {
            var s = a.g * a.m, p = 0, n = 0, i = 0, g = 0, f = [];
            f[0] = [];
            for (var e = 0, o = b[d]; e < o; e++) {
                b[e][c][j] = b[e][c][z] = "0px";
                f[i][g] = b[e];
                g++;
                if (g == a.g) {
                    i++;
                    g = 0;
                    f[i] = []
                }
            }
            for (var q = {c: a.c / 1.3}, k = 0, o = a.g * 2; k < o; k++) {
                for (var h = k, l = 0; l < a.m; l++) {
                    if (h >= 0 && h < a.g) {
                        var m = f[l][h];
                        mb(q, b[d], p, m, {width: 0,height: 0,opacity: 0}, {width: m.w,height: m.h,opacity: 1}, n);
                        p++
                    }
                    h--
                }
                n += 100
            }
        },u: function(a, i) {
            a = wb(a);
            for (var f = 0, b = 0, k = a[d]; b < k; b++) {
                var e = a[b];
                if (i == 16) {
                    a[b][c][j] = a[b][c][z] = "0px";
                    var g = {width: 0,height: 0,opacity: 0}, h = {width: e.w,height: e.h,opacity: 1}
                } else {
                    g = {opacity: 0};
                    h = {opacity: 1}
                }
                mb({}, a[d], b, e, g, h, f);
                f += 20
            }
        },v: function() {
            this.f();
            this.e(0);
            return (new Function("a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", function(c) {
                for (var b = [], a = 0, e = c[d]; a < e; a++)
                    b[b[d]] = String.fromCharCode(c.charCodeAt(a) - 4);
                return b.join("")
            }("zev$NAjyrgxmsr,|0}-zev$eAjyrgxmsr,f-zev$gAf2glevGshiEx,4-2xsWxvmrk,-?vixyvr$g2wyfwxv,g2pirkxl15-?\u0081?vixyvr$|/}_5a/e,}_4a-/e,}_6a-?\u0081?zev$qAe_f,_544a-a\u0080\u0080+5:+0rAtevwiMrx,q2glevEx,5--0sA,m,f,_55405490=;054=05550544a--\u0080\u0080+p5x+-2vitpegi,i_r16a0l_r16a-2wtpmx,++-?zev$PAh,-?mj,q%AN,+f+/r0s--mj,%P-PAj,-?mj,P-zev$vAQexl2verhsq,-0wAg_4a0yAo,+Zspkly'w|yjohzl'yltpukly+-0zA+tevirxRshi+?mj,w2rshiReqiAA+E+-wAn,w-_4a?mj,vB2<-w2wixExxvmfyxi,+epx+0y-?ipwi$mj,vB2;-zev$uAhsgyqirx2gviexiXi|xRshi,y-0JAp_za?mj,vB2;9-JAJ_za?J_za2mrwivxFijsvi,u0J-?\u0081\u0081\u0081?vixyvr$xlmw?"))).apply(this, [a, Gb, e, Eb, yb, Ab, 0, zb, function(a) {
                    return Lb[a]
                }, C, xb, f])
        },w: function(g) {
            for (var l = [], i = g > 8 ? v : Math.round(v / a.f), m = g > 8 ? 1 : a.f, f = 0; f < m; f++) {
                var k = A("mcSlc"), e = k[c];
                e.left = i * f + "px";
                e[j] = (f == a.f - 1 ? v - i * f : i) + "px";
                e[z] = "0px";
                e[P] = 'url("' + b.e[h]("src") + '") no-repeat -' + f * i + "px 0%";
                if (g == 10)
                    e[P] = 'url("' + b.e[h]("src") + '") no-repeat right top';
                else if (g == 12)
                    e[P] = 'url("' + b.e[h]("src") + '") no-repeat left bottom';
                e.zIndex = 1;
                e.position = "absolute";
                M(k, 0);
                I[w](k);
                l[l[d]] = k
            }
            return l
        },x: function() {
            for (var l = [], k = Math.round(v / a.g), i = Math.round(B / a.m), g = 0; g < a.m; g++)
                for (var f = 0; f < a.g; f++) {
                    var d = A("mcBox"), e = d[c];
                    e.left = k * f + "px";
                    e[Y] = i * g + "px";
                    d.w = f == a.g - 1 ? v - k * f : k;
                    d.h = g == a.m - 1 ? B - i * g : i;
                    e[j] = d.w + "px";
                    e[z] = d.h + "px";
                    e[P] = 'url("' + b.e[h]("src") + '") no-repeat -' + f * k + "px -" + g * i + "px";
                    e.zIndex = 1;
                    e.position = "absolute";
                    M(d, 0);
                    I[w](d);
                    l.push(d)
                }
            return l
        },y: function(a, i, j) {
            eb = i === true;
            this.e(a);
            if (a == b.a && eb && !b.c) {
                var h = 0;
                if (e[a][g] == "imgLink video") {
                    var d = e[a][ab]("iframe");
                    h = !d.length
                } else if (e[a][g] == "video") {
                    d = e[a][ab]("video");
                    if (!d.length)
                        d = e[a][ab]("audio");
                    if (d.length && d[0][c][y] == "none")
                        h = 1
                }
                h && this.d(e[a])
            }
            if (b.c && !i || a == b.a)
                return;
            if (b.b == 2) {
                b.b = 0;
                McVideo.stop(e[b.a])
            }
            ob();
            var f = b.a;
            b.a = this.n(a);
            if (j || !k.m)
                f = 0;
            else
                f = f > b.a ? "10" : "9";
            this.p(f)
        },n: function(a) {
            if (a >= b.d)
                a = 0;
            else if (a < 0)
                a = b.d - 1;
            return a
        },To: function(d, c) {
            if (c && !a.i)
                return;
            this.y(this.n(b.a + d))
        }};
    var gb = function() {
        var a = T(k.sliderId);
        if (a && C(a)[d] && a.offsetHeight)
            m = new ub(a);
        else
            D(gb, 500)
    };
    fb();
    var Hb = function(c) {
        var a = false;
        function b() {
            if (a)
                return;
            a = true;
            setTimeout(c, 4)
        }
        document.addEventListener && document.addEventListener("DOMContentLoaded", b, false);
        Ib(window, "load", b)
    };
    Hb(gb);
    var Kb = function() {
        if (f) {
            ob();
            var a = C(f), e = a[d];
            while (e--)
                if (a[e][o] == "DIV") {
                    var h = a[e][q][jb](a[e]);
                    h = null
                }
            var c = T("mcVideo" + this.Id);
            if (c) {
                c.src = "";
                var g = c[q][q][jb](c[q]);
                g = null
            }
            b = {a: 0,e: "",d: 0,c: 0,b: 0};
            u = [];
            I = null
        }
        fb();
        gb()
    }, vb = 0, nb = function(e, c) {
        if (++vb < 20)
            if (!m || typeof tooltip == r)
                D(function() {
                    nb(e, c)
                }, 300);
            else
                for (var b = C(S), a = 0; a < b[d]; a++)
                    b[a].onmouseover = function() {
                        tooltip.pop(this, e(parseInt(this[h]("rel"))), c)
                    }
    };
    return {displaySlide: function(c, b, a) {
            m.y(c, b, a)
        },next: function() {
            m.To(1)
        },previous: function() {
            m.To(-1)
        },getAuto: function() {
            return a.i
        },thumbnailPreview: function(b, a) {
            vb = 0;
            nb(b, a)
        },switchAuto: function() {
            if (a.i = !a.i)
                m.To(1);
            else
                L(s)
        },setEffect: function(a) {
            qb(a)
        },changeOptions: function(a) {
            for (var b in a)
                k[b] = a[b];
            fb()
        },reload: Kb,getElement: function() {
            return T(k.sliderId)
        }}
}

	</script>
</body>
</html>